mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-25 10:40:21 -06:00
Ensure we do not dereference nullptr.
This commit is contained in:
parent
dd93a67086
commit
4f414b78ed
@ -1067,14 +1067,14 @@ namespace Opm {
|
||||
int
|
||||
BlackoilWellModel<TypeTag>:: numWells() const
|
||||
{
|
||||
return wells()->number_of_wells;
|
||||
return wells() ? wells()->number_of_wells : 0;
|
||||
}
|
||||
|
||||
template<typename TypeTag>
|
||||
int
|
||||
BlackoilWellModel<TypeTag>:: numPhases() const
|
||||
{
|
||||
return wells()->number_of_phases;
|
||||
return wells() ? wells()->number_of_phases : 1;
|
||||
}
|
||||
|
||||
template<typename TypeTag>
|
||||
|
Loading…
Reference in New Issue
Block a user