Merge pull request #15911 from amerhifi/bugz-968

case Bugz-968 adding a null check to the display plugin. Possible that display plug…
This commit is contained in:
Shannon Romano 2019-07-15 08:35:29 -07:00 committed by GitHub
commit 1bc72a86da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -2810,7 +2810,7 @@ void Application::cleanupBeforeQuit() {
DependencyManager::destroy<TabletScriptingInterface>();
DependencyManager::destroy<ToolbarScriptingInterface>();
DependencyManager::destroy<OffscreenUi>();
DependencyManager::destroy<OffscreenQmlSurfaceCache>();
_snapshotSoundInjector = nullptr;

View file

@ -47,5 +47,9 @@ void AbstractHMDScriptingInterface::setIPDScale(float IPDScale) {
}
bool AbstractHMDScriptingInterface::isHMDMode() const {
return PluginContainer::getInstance().getActiveDisplayPlugin()->isHmd();
}
auto displayPlugin = PluginContainer::getInstance().getActiveDisplayPlugin();
if (displayPlugin) {
return displayPlugin->isHmd();
}
return false;
}