#14168 Fix crash creating grid statistics plot for result without statistics cache entry

When creating a grid statistics plot from a view result whose address is valid by name but not present in the case result cache, statistics() was indexed with UNDEFINED_SIZE_T and the CAF_ASSERT aborted. Guard the all-cells branch with hasResultEntry() so an empty histogram is produced instead.
This commit is contained in:
Magne Sjaastad committed 2026-06-10 12:33:25 +02:00
1 parent f1218e527f
commit 96aceb23a7
1 file changed
+1 -1
@@ -252,7 +252,7 @@ RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView*
{
RigEclipseResultAddress eclResAddr = eclResultDefinition->eclipseResultAddress();
RigCaseCellResultsData* cellResults = eclResultDefinition->currentGridCellResults();
if ( cellResults && eclResAddr.isValid() )
if ( cellResults && eclResAddr.isValid() && cellResults->hasResultEntry( eclResAddr ) )
{
if ( timeRange == StatisticsTimeRangeType::ALL_TIMESTEPS )
{