mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 22:27:55 -05:00
RigFlowDiagResults::activeCellInfo() dereferences the ancestor RimEclipseResultCase and its eclipseCaseData() unchecked. The derived results (TOF, Cell Fraction, Communication, Max Fraction Tracer) crash when the solution is detached or the case data is released. activeCellInfo() now returns nullptr when the case or its data is missing, and the derived-result calculations return nullptr in that case. New test RigFlowDiagResults.DerivedResultWithoutEclipseCase. Call stack: [4] RigFlowDiagResults::calculateDerivedResult(RigFlowDiagResultAddress const&, unsigned long) at ResInsight/ApplicationLibCode/ReservoirDataModel/RigFlowDiagResults.cpp:211 [5] RigFlowDiagResults::findOrCalculateResult(RigFlowDiagResultAddress const&, unsigned long) at ResInsight/ApplicationLibCode/ReservoirDataModel/RigFlowDiagResults.cpp:95 [6] RigFlowDiagStatCalc::minMaxCellScalarValues(unsigned long, double&, double&) at ResInsight/ApplicationLibCode/ReservoirDataModel/RigFlowDiagStatCalc.cpp:49 [7] RigStatisticsDataCache::minMaxCellScalarValues(unsigned long, double&, double&) at ResInsight/ApplicationLibCode/ResultStatisticsCache/RigStatisticsDataCache.cpp:121 [8] RimEclipseResultDefinitionTools::updateLegendForFlowDiagnostics(...) at ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinitionTools.cpp:422 [9] RimEclipseResultDefinition::updateRangesForExplicitLegends(...) at ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinition.cpp:1705 [10] RimEclipseView::updateLegendRangesTextAndVisibility(...) at ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp:1699 [11] RimEclipseView::onUpdateLegends() at ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp:1568 [12] RimEclipseView::onCreateDisplayModel() at ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp:854