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:
@@ -1914,10 +1914,12 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// make sure no window is chosen that doesn't want focus or cannot have it
|
||||
while (nextFocus != NULL && !_WindowCanHaveFocus(nextFocus)) {
|
||||
|
||||
Reference in New Issue
Block a user