From 4fa00a52529722761e161a56f6bffffb3bbcfbdc Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 17 Apr 2020 13:09:28 +0200 Subject: [PATCH] Guard null pointer access --- ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp | 2 +- ApplicationCode/ProjectDataModel/RimSimWellInView.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index 1f65cb47a1..1863f13c4d 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -652,7 +652,7 @@ QList { RigCaseCellResultsData* cellResultsData = m_eclipseCase->results( this->porosityModel() ); - if ( cellResultsData->hasFlowDiagUsableFluxes() ) + if ( cellResultsData && cellResultsData->hasFlowDiagUsableFluxes() ) { enableSouring = true; } diff --git a/ApplicationCode/ProjectDataModel/RimSimWellInView.cpp b/ApplicationCode/ProjectDataModel/RimSimWellInView.cpp index e3493c7200..1cfd675104 100644 --- a/ApplicationCode/ProjectDataModel/RimSimWellInView.cpp +++ b/ApplicationCode/ProjectDataModel/RimSimWellInView.cpp @@ -649,6 +649,7 @@ double RimSimWellInView::calculateInjectionProductionFractions( const RimWellDis const RimEclipseView* reservoirView = nullptr; this->firstAncestorOrThisOfType( reservoirView ); if ( !reservoirView ) return false; + if ( !reservoirView->eclipseCase() ) return false; size_t timeStep = static_cast( reservoirView->currentTimeStep() ); std::vector caseTimeSteps = reservoirView->eclipseCase()->timeStepDates();