src/macosx/native/sun/awt/AWTWindow.m

Print this page

        

@@ -537,11 +537,11 @@
 AWT_ASSERT_APPKIT_THREAD;
     [AWTToolkit eventCountPlusPlus];
     AWTWindow *opposite = [AWTWindow lastKeyWindow];
     if (!IS(self.styleBits, IS_DIALOG)) {
         [CMenuBar activate:self.javaMenuBar modallyDisabled:NO];
-    } else if (IS(self.styleBits, IS_MODAL)) {
+    } else if ((opposite != NULL) && IS(self.styleBits, IS_MODAL)) {
         [CMenuBar activate:opposite->javaMenuBar modallyDisabled:YES];        
     }
     [AWTWindow setLastKeyWindow:nil];
 
     [self _deliverWindowFocusEvent:YES oppositeWindow: opposite];