app_server: Fixed crash if there is no window.

This commit is contained in:
Axel Dörfler
2016-07-24 23:14:37 +02:00
parent 6331a6bd91
commit 871a4f63c7
+3 -3
View File
@@ -1592,7 +1592,7 @@ Desktop::SetWindowWorkspaces(Window* window, uint32 workspaces)
/*! \brief Adds the window to the desktop.
At this point, the window is still hidden and must be shown explicetly
At this point, the window is still hidden and must be shown explicitly
via ShowWindow().
*/
void
@@ -2117,7 +2117,7 @@ Desktop::RedrawBackground()
BRegion redraw;
Window* window = CurrentWindows().FirstWindow();
if (window->Feel() == kDesktopWindowFeel) {
if (window != NULL && window->Feel() == kDesktopWindowFeel) {
redraw = window->VisibleContentRegion();
// look for desktop background view, and update its background color
@@ -2126,7 +2126,7 @@ Desktop::RedrawBackground()
if (view != NULL)
view = view->FirstChild();
while (view) {
while (view != NULL) {
if (view->IsDesktopBackground()) {
view->SetViewColor(fWorkspaces[fCurrentWorkspace].Color());
break;