Ensure we do not dereference nullptr.

This commit is contained in:
Atgeirr Flø Rasmussen
2018-02-13 16:22:11 +01:00
parent dd93a67086
commit 4f414b78ed

View File

@@ -1067,14 +1067,14 @@ namespace Opm {
int int
BlackoilWellModel<TypeTag>:: numWells() const BlackoilWellModel<TypeTag>:: numWells() const
{ {
return wells()->number_of_wells; return wells() ? wells()->number_of_wells : 0;
} }
template<typename TypeTag> template<typename TypeTag>
int int
BlackoilWellModel<TypeTag>:: numPhases() const BlackoilWellModel<TypeTag>:: numPhases() const
{ {
return wells()->number_of_phases; return wells() ? wells()->number_of_phases : 1;
} }
template<typename TypeTag> template<typename TypeTag>