History

check for null when we dont

Dante Ruiz committed 9 years ago

Commit b2a11aa1 parent 788849e1 file · +5 −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+5−0
@@ -81,6 +81,11 @@ void TabletScriptingInterface::setQmlTabletRoot(QString tabletId, QQuickItem* qm · 80 unmodified lines
81 81
82QQuickWindow* TabletScriptingInterface::getTabletWindow() {82QQuickWindow* TabletScriptingInterface::getTabletWindow() {
83 TabletProxy* tablet = qobject_cast<TabletProxy*>(getTablet("com.highfidelity.interface.tablet.system"));83 TabletProxy* tablet = qobject_cast<TabletProxy*>(getTablet("com.highfidelity.interface.tablet.system"));
84
85 if (!tablet) {
86 return nullptr;
87 }
88
84 QObject* qmlSurface = tablet->getTabletSurface();89 QObject* qmlSurface = tablet->getTabletSurface();
85 OffscreenQmlSurface* surface = dynamic_cast<OffscreenQmlSurface*>(qmlSurface);90 OffscreenQmlSurface* surface = dynamic_cast<OffscreenQmlSurface*>(qmlSurface);
86 91