From f47bef09a25117f0517eb940d05d0cd1dc3f48c2 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 15 Jul 2013 19:33:17 -0400 Subject: [PATCH] Deskbar: Check if window is NULL. Fixes #9860 It is possible, through the right combination of steps, for this method to be run on startup before the view is attached to the window causing a crash because Window() returns NULL. This fix returns false in this case instead. Later, when an application such as Tracker is started and added to Deskbar this method will be run again with the view attached to the window. --- src/apps/deskbar/ExpandoMenuBar.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp index 4b949653da..aec2ce7552 100644 --- a/src/apps/deskbar/ExpandoMenuBar.cpp +++ b/src/apps/deskbar/ExpandoMenuBar.cpp @@ -865,6 +865,9 @@ bool TExpandoMenuBar::CheckForSizeOverrun() { if (fVertical) { + if (Window() == NULL) + return false; + BRect screenFrame = (BScreen(Window())).Frame(); return Window()->Frame().bottom > screenFrame.bottom; }