History

more safeguards

HifiExperiments committed 5 years ago

Commit 2667af31 parent 3335c0417 files · +94 −73Browse files

Showing the changes to interface/src/scripting/DesktopScriptingInterface.cpp (1 of 17 files). Show all

Unified · Split

interface/src/scripting/DesktopScriptingInterface.cpp+6−1
@@ -99,11 +99,16 @@ void DesktopScriptingInterface::setHUDAlpha(float alpha) { · 98 unmodified lines
9999 }
100100
101101 void DesktopScriptingInterface::show(const QString& path, const QString& title) {
102+ auto offscreenUI = DependencyManager::get<OffscreenUi>();
103+ if (!offscreenUI) {
104+ return;
105+ }
106+
102107 if (QThread::currentThread() != thread()) {
103108 QMetaObject::invokeMethod(this, "show", Qt::QueuedConnection, Q_ARG(QString, path), Q_ARG(QString, title));
104109 return;
105110 }
106− DependencyManager::get<OffscreenUi>()->show(path, title);
111+ offscreenUI->show(path, title);
107112 }
108113
109114 InteractiveWindowPointer DesktopScriptingInterface::createWindow(const QString& sourceUrl, const QVariantMap& properties) {