Merge pull request #4086 from bska/dont-deref-nullptr

Max 2P Sat-Sum: Don't Dereference Null Pointer
This commit is contained in:
Magne Sjaastad
2019-02-14 07:09:56 +01:00
committed by GitHub

View File

@@ -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];
}
}