mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 09:43:51 +02:00
Fix crash when try to remove invalid menu item in JavaScript
This commit is contained in:
parent
ddf5539a49
commit
d6b13ef42c
1 changed files with 4 additions and 0 deletions
|
@ -183,6 +183,10 @@ void VrMenu::insertAction(QAction* before, QAction* action) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VrMenu::removeAction(QAction* action) {
|
void VrMenu::removeAction(QAction* action) {
|
||||||
|
if (!action) {
|
||||||
|
qWarning("Attempted to remove invalid menu action");
|
||||||
|
return;
|
||||||
|
}
|
||||||
MenuUserData* userData = MenuUserData::forObject(action);
|
MenuUserData* userData = MenuUserData::forObject(action);
|
||||||
if (!userData) {
|
if (!userData) {
|
||||||
qWarning("Attempted to remove menu action with no found QML object");
|
qWarning("Attempted to remove menu action with no found QML object");
|
||||||
|
|
Loading…
Reference in a new issue