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; + } } }