mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-21 14:41:36 +00:00
Protect against [window screen] returning nil.
This commit is contained in:
parent
020d3fa183
commit
e3d51643ca
3 changed files with 20 additions and 3 deletions
|
@ -1545,7 +1545,7 @@ static BOOL menuBarVisible = YES;
|
|||
[_view sizeToFit];
|
||||
|
||||
menuFrame = [_view frame];
|
||||
|
||||
|
||||
// Main
|
||||
oldWindowFrame = [_aWindow frame];
|
||||
newWindowFrame = [NSWindow frameRectForContentRect: menuFrame
|
||||
|
@ -1855,7 +1855,15 @@ static BOOL menuBarVisible = YES;
|
|||
NSWindow *window;
|
||||
|
||||
window = [self window];
|
||||
return !NSContainsRect([[window screen] visibleFrame], [window frame]);
|
||||
if ((nil != window) && (nil != [window screen]))
|
||||
{
|
||||
return !NSContainsRect([[window screen] visibleFrame], [window frame]);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Menu has no window %@ or screen %@", window, [window screen]);
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) _performMenuClose: (id)sender
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue