diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index e4baaab3d3..4d35b3202e 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -218,10 +218,9 @@ void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem) NSMenuItem *oldItem = [m_nativeMenu itemWithTag:(NSInteger) cocoaItem]; if (cocoaItem->sync() != oldItem) { - // native item was changed for some reason - if (!wasMerged) { + // native item was changed for some reason + if (!wasMerged && oldItem) [m_nativeMenu removeItem:oldItem]; - } QCocoaMenuItem* beforeItem = itemOrNull(m_menuItems.indexOf(cocoaItem) + 1); insertNative(cocoaItem, beforeItem);