From 451ce82aa9b001d1260b299f357679799198f950 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 29 Jun 2018 16:41:14 +0200 Subject: [PATCH] Guard null pointer access --- .../Intersections/RivIntersectionPartMgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp index 4f11900fd8..a94c9f0f54 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp @@ -1035,9 +1035,10 @@ cvf::ref RivIntersectionPartMgr::createHexGridI RimGeoMechView* geoView; m_rimCrossSection->firstAncestorOrThisOfType(geoView); - if (geoView) + if (geoView && geoView->femParts() && geoView->femParts()->partCount()) { RigFemPart* femPart = geoView->femParts()->part(0); + return new RivFemIntersectionGrid(femPart); }