History

Bug 4255: When you are in HMD and you go to file menu quit, it crashes and you have no menus when you come back. Fixed NPE of buttonProxy while doing addButtonProxyToQmlTablet on quitting the application.

volansystech committed 9 years ago

Commit 34edc231 parent d40984b1 file · +4 −0Browse files

Showing the changes to libraries/script-engine/src/TabletScriptingInterface.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/TabletScriptingInterface.cpp+4−0
@@ -250,6 +250,10 @@ static void addButtonProxyToQmlTablet(QQuickItem* qmlTablet, TabletButtonProxy* · 249 unmodified lines
250250 if (QThread::currentThread() != qmlTablet->thread()) {
251251 connectionType = Qt::BlockingQueuedConnection;
252252 }
253+ if (buttonProxy == NULL){
254+ qCCritical(scriptengine) << "TabletScriptingInterface addButtonProxyToQmlTablet buttonProxy is NULL";
255+ return;
256+ }
253257 bool hasResult = QMetaObject::invokeMethod(qmlTablet, "addButtonProxy", connectionType,
254258 Q_RETURN_ARG(QVariant, resultVar), Q_ARG(QVariant, buttonProxy->getProperties()));
255259 if (!hasResult) {