From 6ad0bcee95be08bd28e06cb91f1271d6a16f70ea Mon Sep 17 00:00:00 2001 From: jonjenssen Date: Wed, 29 Jun 2022 13:35:28 +0200 Subject: [PATCH] Fix crash if base time step has undefined data --- .../ReservoirDataModel/RigCaseCellResultCalculator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultCalculator.cpp b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultCalculator.cpp index c35e6826e2..ac00907433 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultCalculator.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultCalculator.cpp @@ -148,9 +148,11 @@ bool RigCaseCellResultCalculator::computeDifference( RigEclipseCaseData* { cvf::ref sourceResultAccessor = RigResultAccessorFactory::createFromResultAddress( sourceCase, gridIdx, porosityModel, fIdx, nativeAddress ); + if ( sourceResultAccessor.isNull() ) continue; cvf::ref resultModifier = RigResultModifierFactory::createResultModifier( sourceCase, gridIdx, porosityModel, fIdx, address ); + if ( resultModifier.isNull() ) continue; size_t baseFrameIdx = fIdx; if ( address.isDeltaTimeStepActive() ) @@ -160,6 +162,7 @@ bool RigCaseCellResultCalculator::computeDifference( RigEclipseCaseData* cvf::ref baseResultAccessor = RigResultAccessorFactory::createFromResultAddress( baseCase, gridIdx, porosityModel, baseFrameIdx, nativeAddress ); + if ( baseResultAccessor.isNull() ) continue; for ( size_t localGridCellIdx = 0; localGridCellIdx < grid->cellCount(); localGridCellIdx++ ) {