History

more safeguards

HifiExperiments committed 5 years ago

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

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

Unified · Split

interface/src/scripting/HMDScriptingInterface.cpp+6−4
@@ -96,8 +96,9 @@ bool HMDScriptingInterface::shouldShowHandControllers() const { · 95 unmodified lines
9696
9797 void HMDScriptingInterface::activateHMDHandMouse() {
9898 QWriteLocker lock(&_hmdHandMouseLock);
99− auto offscreenUi = DependencyManager::get<OffscreenUi>();
100− offscreenUi->getDesktop()->setProperty("hmdHandMouseActive", true);
99+ if (auto offscreenUI = DependencyManager::get<OffscreenUi>()) {
100+ offscreenUI->getDesktop()->setProperty("hmdHandMouseActive", true);
101+ }
101102 _hmdHandMouseCount++;
102103 }
103104
@@ -105,8 +106,9 @@ void HMDScriptingInterface::deactivateHMDHandMouse() { · 1 unmodified line
105106 QWriteLocker lock(&_hmdHandMouseLock);
106107 _hmdHandMouseCount = std::max(_hmdHandMouseCount - 1, 0);
107108 if (_hmdHandMouseCount == 0) {
108− auto offscreenUi = DependencyManager::get<OffscreenUi>();
109− offscreenUi->getDesktop()->setProperty("hmdHandMouseActive", false);
109+ if (auto offscreenUI = DependencyManager::get<OffscreenUi>()) {
110+ offscreenUI->getDesktop()->setProperty("hmdHandMouseActive", false);
111+ }
110112 }
111113 }
112114

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t