diff --git a/src/plugins/platforms/cocoa/qmenu_mac.mm b/src/plugins/platforms/cocoa/qmenu_mac.mm index cfedf06daf..f62e4a9fd2 100644 --- a/src/plugins/platforms/cocoa/qmenu_mac.mm +++ b/src/plugins/platforms/cocoa/qmenu_mac.mm @@ -755,9 +755,10 @@ void QCocoaMenu::setMenuEnabled(bool enable) } } } else { - NSMenu *menu = menu; - for (NSMenuItem *item in [menu itemArray]) { - [item setEnabled:false]; + NSMenu *m = menu; + for (NSMenuItem *item in [m itemArray]) { + if (item) + [item setEnabled:false]; } } }