From 890be1b590b3b5240186eed9aabef7a9a9f21b83 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 25 Sep 2022 12:31:56 +0400 Subject: [PATCH] Fix crash in the editor --- components/sceneutil/statesetupdater.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/components/sceneutil/statesetupdater.cpp b/components/sceneutil/statesetupdater.cpp index 7bb65798cd..89017e628b 100644 --- a/components/sceneutil/statesetupdater.cpp +++ b/components/sceneutil/statesetupdater.cpp @@ -42,11 +42,14 @@ namespace SceneUtil { auto stateset = getCvDependentStateset(cv); apply(stateset, cv); - auto& sm = Stereo::Manager::instance(); - if (sm.getEye(cv) == Stereo::Eye::Left) - applyLeft(stateset, cv); - if (sm.getEye(cv) == Stereo::Eye::Right) - applyRight(stateset, cv); + auto* sm = &Stereo::Manager::instance(); + if (sm != nullptr) + { + if (sm->getEye(cv) == Stereo::Eye::Left) + applyLeft(stateset, cv); + if (sm->getEye(cv) == Stereo::Eye::Right) + applyRight(stateset, cv); + } cv->pushStateSet(stateset); traverse(node, cv);