mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-22 09:16:27 -06:00
Merge pull request #1404 from atgeirr/fix-no-wells
Ensure we do not dereference nullptr.
This commit is contained in:
commit
17a524e42c
@ -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