diff --git a/src/osx/cocoa/menu.mm b/src/osx/cocoa/menu.mm index 2222793676..09a753f6b5 100644 --- a/src/osx/cocoa/menu.mm +++ b/src/osx/cocoa/menu.mm @@ -91,7 +91,8 @@ if ( menuimpl ) { wxMenu* wxpeer = (wxMenu*) menuimpl->GetWXPeer(); - wxpeer->HandleMenuOpened(); + if ( wxpeer ) + wxpeer->HandleMenuOpened(); } } @@ -102,7 +103,8 @@ if ( menuimpl ) { wxMenu* wxpeer = (wxMenu*) menuimpl->GetWXPeer(); - wxpeer->HandleMenuClosed(); + if ( wxpeer ) + wxpeer->HandleMenuClosed(); } }