From 3a05abb42b5b36665e702f1da75344e76820a00d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Tue, 22 May 2018 09:34:27 +0200 Subject: [PATCH] #2940 Fix crash due to missing guard in geomech camera conversion. --- ApplicationCode/ProjectDataModel/RimGeoMechView.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp index 08e3fb3ab2..bfbfbe501b 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp @@ -599,8 +599,11 @@ void RimGeoMechView::convertCameraPositionFromOldProjectFiles() viewerToViewInterface->setCameraPointOfInterest(newPointOfInterest); } - m_viewer->mainCamera()->setViewMatrix( this->cameraPosition()); - m_viewer->setPointOfInterest(this->cameraPointOfInterest()); + if (m_viewer) + { + m_viewer->mainCamera()->setViewMatrix(this->cameraPosition()); + m_viewer->setPointOfInterest(this->cameraPointOfInterest()); + } } }