From 5d37a076d5fb389d7a24f51878b167652c28b4e1 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Mon, 20 May 2019 13:05:57 -0700 Subject: [PATCH] Don't crash on trying to add items to non-existent menus --- libraries/ui-plugins/src/ui-plugins/PluginContainer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/ui-plugins/src/ui-plugins/PluginContainer.cpp b/libraries/ui-plugins/src/ui-plugins/PluginContainer.cpp index 58dc971cb9..0c71d4fa69 100644 --- a/libraries/ui-plugins/src/ui-plugins/PluginContainer.cpp +++ b/libraries/ui-plugins/src/ui-plugins/PluginContainer.cpp @@ -72,6 +72,11 @@ struct MenuCache { } flushCache(menu); MenuWrapper* parentItem = menu->getMenu(path); + if (!parentItem) { + qWarning() << "Attempted to add item to non-existent path " << path; + return; + } + QAction* action = menu->addActionToQMenuAndActionHash(parentItem, name); if (!groupName.isEmpty()) { QActionGroup* group{ nullptr };