From 486aaa49f3cf67c1a1d10a199c2101b6069edc38 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Thu, 7 Feb 2013 21:13:09 -0500 Subject: [PATCH] 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) --- src/servers/app/Desktop.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index 76c8084eef..4663c0b9e3 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -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; + } } }