From 360a635cda3a92fe4fe23203e72bb439a53a80a9 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 27 Sep 2024 07:16:10 +0200 Subject: [PATCH] Guard null pointer access --- ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp index 96fc88b4bd..db56d9b746 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp @@ -2363,6 +2363,8 @@ void RimEclipseView::calculateCurrentTotalCellVisibility( cvf::UByteArray* total //-------------------------------------------------------------------------------------------------- void RimEclipseView::calculateCellVisibility( cvf::UByteArray* visibility, std::vector geomTypes, int timeStep ) { + if ( !mainGrid() ) return; + size_t cellCount = mainGrid()->globalCellArray().size(); visibility->resize( cellCount );