Check to make sure lastFocus is not NULL before using it.

This prevents an app_server crash on startup for me most likely
introduced in hrev45252. (Just a few commits ago)
This commit is contained in:
John Scipione 2013-02-07 21:13:09 -05:00
parent fef7dd705f
commit 486aaa49f3

View File

@ -1914,8 +1914,10 @@ Desktop::SetFocusWindow(Window* nextFocus)
// If the last window having focus is a window that cannot make it
// to the front, we use that as the next focus
Window* lastFocus = fFocusList.LastWindow();
if (!lastFocus->SupportsFront() && _WindowCanHaveFocus(lastFocus))
if (lastFocus != NULL && !lastFocus->SupportsFront()
&& _WindowCanHaveFocus(lastFocus)) {
nextFocus = lastFocus;
}
}
}