mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Ensure we do not dereference nullptr.
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user