diff --git a/opm/autodiff/BlackoilWellModel_impl.hpp b/opm/autodiff/BlackoilWellModel_impl.hpp index 15209a624..7e5489c76 100644 --- a/opm/autodiff/BlackoilWellModel_impl.hpp +++ b/opm/autodiff/BlackoilWellModel_impl.hpp @@ -1067,14 +1067,14 @@ namespace Opm { int BlackoilWellModel:: numWells() const { - return wells()->number_of_wells; + return wells() ? wells()->number_of_wells : 0; } template int BlackoilWellModel:: numPhases() const { - return wells()->number_of_phases; + return wells() ? wells()->number_of_phases : 1; } template