mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Max 2P Sat-Sum: Don't Dereference Null Pointer
A simulation run might not activate all three phases. We therefore must guard against querying the connate saturations of the missing phase. Pointy hat: Bard.Skaflestad@sintef.no Thanks to: Magne Sjåstad
This commit is contained in:
@@ -2477,7 +2477,10 @@ max2PSatSum(const RawCurve& fi,
|
||||
}
|
||||
}
|
||||
else {
|
||||
const auto swco = this->wat_->swco();
|
||||
const auto swco = (this->wat_ != nullptr)
|
||||
? this->wat_->swco()
|
||||
: std::vector<double>(this->numTables_, 0.0);
|
||||
|
||||
smin = swco[regID - 1];
|
||||
}
|
||||
}
|
||||
@@ -2494,7 +2497,10 @@ max2PSatSum(const RawCurve& fi,
|
||||
}
|
||||
}
|
||||
else {
|
||||
const auto sgco = this->gas_->sgco();
|
||||
const auto sgco = (this->gas_ != nullptr)
|
||||
? this->gas_->sgco()
|
||||
: std::vector<double>(this->numTables_, 0.0);
|
||||
|
||||
smin = sgco[regID - 1];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user