mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Flow Diagnostics : Guard null pointer access
This commit is contained in:
parent
c687a5bb5e
commit
ac8c6edafa
@ -126,7 +126,7 @@ std::vector<QString> RimFlowDiagSolution::tracerNames() const
|
||||
|
||||
std::vector<QString> tracerNameSet;
|
||||
|
||||
if (eclCase)
|
||||
if (eclCase && eclCase->eclipseCaseData())
|
||||
{
|
||||
const cvf::Collection<RigSimWellData>& simWellData = eclCase->eclipseCaseData()->wellResults();
|
||||
|
||||
@ -166,7 +166,7 @@ std::map<std::string, std::vector<int> > RimFlowDiagSolution::allTracerActiveCel
|
||||
|
||||
std::map<std::string, std::vector<int> > tracersWithCells;
|
||||
|
||||
if ( eclCase )
|
||||
if (eclCase && eclCase->eclipseCaseData())
|
||||
{
|
||||
const cvf::Collection<RigSimWellData>& simWellData = eclCase->eclipseCaseData()->wellResults();
|
||||
RigMainGrid* mainGrid = eclCase->eclipseCaseData()->mainGrid();
|
||||
@ -227,7 +227,8 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(c
|
||||
this->firstAncestorOrThisOfTypeAsserted(eclCase);
|
||||
|
||||
TracerStatusType tracerStatus = UNDEFINED;
|
||||
|
||||
if (eclCase && eclCase->eclipseCaseData())
|
||||
{
|
||||
const cvf::Collection<RigSimWellData>& simWellData = eclCase->eclipseCaseData()->wellResults();
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < simWellData.size(); ++wIdx )
|
||||
@ -262,6 +263,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(c
|
||||
if (tracerStatus == PRODUCER) tracerStatus = INJECTOR;
|
||||
else if (tracerStatus == INJECTOR) tracerStatus = PRODUCER;
|
||||
}
|
||||
}
|
||||
|
||||
return tracerStatus;
|
||||
}
|
||||
@ -274,6 +276,8 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
|
||||
RimEclipseResultCase* eclCase;
|
||||
this->firstAncestorOrThisOfTypeAsserted(eclCase);
|
||||
|
||||
if (eclCase && eclCase->eclipseCaseData())
|
||||
{
|
||||
const cvf::Collection<RigSimWellData>& simWellData = eclCase->eclipseCaseData()->wellResults();
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < simWellData.size(); ++wIdx )
|
||||
@ -307,6 +311,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
|
||||
}
|
||||
|
||||
CVF_ASSERT(false);
|
||||
}
|
||||
|
||||
return UNDEFINED;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user