Merge pull request #15589 from jherico/fix/bugz-250

BUGZ-250: Don't crash on trying to add items to non-existent menus
This commit is contained in:
Andrew Meadows 2019-05-20 14:35:52 -07:00 committed by GitHub
commit 172b7b8d17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 };