mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-14 09:52:01 -05:00
Ensure we do not dereference nullptr.
This commit is contained in:
1 parent
dd93a67086
commit
4f414b78ed
1 file changed
+2
-2
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user