Fix crash when try to remove invalid menu item in JavaScript

This commit is contained in:
David Rowe 2015-11-28 11:12:39 +13:00
parent ddf5539a49
commit d6b13ef42c

View file

@ -183,6 +183,10 @@ void VrMenu::insertAction(QAction* before, QAction* action) {
}
void VrMenu::removeAction(QAction* action) {
if (!action) {
qWarning("Attempted to remove invalid menu action");
return;
}
MenuUserData* userData = MenuUserData::forObject(action);
if (!userData) {
qWarning("Attempted to remove menu action with no found QML object");