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.
This commit is contained in:
John Scipione 2013-07-15 19:33:17 -04:00
parent ddc2a758e6
commit f47bef09a2

View File

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