mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-14 11:46:34 +02:00
Don't bind action if QML menu can't be added.
Otherwise eventually methods will be called on a NULL pointer. Fixes crash related to QMetaObject::invokeMethod.
This commit is contained in:
parent
acfda3ba49
commit
dabda684b8
1 changed files with 5 additions and 1 deletions
|
@ -269,7 +269,11 @@ void VrMenu::insertAction(QAction* before, QAction* action) {
|
|||
Q_ASSERT(invokeResult);
|
||||
QObject* result = reinterpret_cast<QObject*>(returnedValue); // returnedValue.value<QObject*>();
|
||||
Q_ASSERT(result);
|
||||
bindActionToQmlAction(result, action, _rootMenu);
|
||||
if ( result ) {
|
||||
bindActionToQmlAction(result, action, _rootMenu);
|
||||
} else {
|
||||
qWarning() << "Failed to find addItem() method in object " << menu << ". Not inserting action " << action;
|
||||
}
|
||||
}
|
||||
|
||||
class QQuickMenuBase;
|
||||
|
|
Loading…
Reference in a new issue