diff --git a/opm/simulators/wells/StandardWellGeneric.hpp b/opm/simulators/wells/StandardWellGeneric.hpp index 812b07f63..4cd02f783 100644 --- a/opm/simulators/wells/StandardWellGeneric.hpp +++ b/opm/simulators/wells/StandardWellGeneric.hpp @@ -106,7 +106,10 @@ protected: mutable BVectorWell Bx_; mutable BVectorWell invDrw_; - double getRho() const { return perf_densities_[0]; } + double getRho() const + { + return this->perf_densities_.empty() ? 0.0 : perf_densities_[0]; + } }; }