mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 18:06:57 +02:00
Don't crash on trying to add items to non-existent menus
This commit is contained in:
parent
5fbb788492
commit
5d37a076d5
1 changed files with 5 additions and 0 deletions
|
@ -72,6 +72,11 @@ struct MenuCache {
|
||||||
}
|
}
|
||||||
flushCache(menu);
|
flushCache(menu);
|
||||||
MenuWrapper* parentItem = menu->getMenu(path);
|
MenuWrapper* parentItem = menu->getMenu(path);
|
||||||
|
if (!parentItem) {
|
||||||
|
qWarning() << "Attempted to add item to non-existent path " << path;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QAction* action = menu->addActionToQMenuAndActionHash(parentItem, name);
|
QAction* action = menu->addActionToQMenuAndActionHash(parentItem, name);
|
||||||
if (!groupName.isEmpty()) {
|
if (!groupName.isEmpty()) {
|
||||||
QActionGroup* group{ nullptr };
|
QActionGroup* group{ nullptr };
|
||||||
|
|
Loading…
Reference in a new issue