From c7185649ce3573e617c64b14b3c5c42d6046d681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Fri, 26 Jan 2018 11:15:32 +0100 Subject: [PATCH] Caf: Guard against crash when point of interest is not set correctly --- Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.cpp b/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.cpp index 519b5d8534..48c9be65f5 100644 --- a/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.cpp +++ b/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.cpp @@ -190,7 +190,7 @@ cvf::ref caf::TrackBallBasedNavigation::createZoomRay(int cvfXPos, int cvf::Camera* cam = m_viewer->mainCamera(); ray = cam->rayFromWindowCoordinates(cvfXPos, cvfYPos); - if (cam->projection() == cvf::Camera::ORTHO) + if (ray.notNull() && cam->projection() == cvf::Camera::ORTHO) { cvf::Vec3d camDir = cam->direction(); cvf::Plane focusPlane;