Skip to content

Commit

Permalink
macOS: Prevent mac menu bar submenus with empty names being used as t…
Browse files Browse the repository at this point in the history
…he recent items menu
  • Loading branch information
ed95 committed Jun 18, 2019
1 parent 5360191 commit b0934f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/juce_gui_basics/native/juce_mac_MainMenu.mm
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ void addMenuItem (PopupMenu::MenuItemIterator& iter, NSMenu* menuToAddTo,
}
else if (i.subMenu != nullptr)
{
if (i.text == recentItemsMenuName)
if (recentItemsMenuName.isNotEmpty() && i.text == recentItemsMenuName)
{
if (recent == nullptr)
recent.reset (new RecentFilesMenuItem());
recent = std::make_unique<RecentFilesMenuItem>();

if (recent->recentItem != nil)
{
Expand Down Expand Up @@ -572,7 +572,7 @@ static void menuNeedsUpdate (id self, SEL, NSMenu* menu)
: oldMenu (MenuBarModel::getMacMainMenu())
{
if (auto* appleMenu = MenuBarModel::getMacExtraAppleItemsMenu())
oldAppleMenu.reset (new PopupMenu (*appleMenu));
oldAppleMenu = std::make_unique<PopupMenu> (*appleMenu);

if (auto* handler = JuceMainMenuHandler::instance)
oldRecentItems = handler->recentItemsMenuName;
Expand Down

0 comments on commit b0934f8

Please sign in to comment.