mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-25 16:51:00 -06:00
Merge pull request #4259 from blattms/do-dereference-unset-optional
[bugfix] Do not unconditionally dereference std::optional.
This commit is contained in:
commit
58d8ca144e
@ -682,7 +682,11 @@ namespace WellGroupHelpers
|
||||
if (!gpm)
|
||||
return;
|
||||
|
||||
const auto [name, number] = *gpm->region();
|
||||
const auto& region = gpm->region();
|
||||
if (!region)
|
||||
return;
|
||||
|
||||
const auto [name, number] = *region;
|
||||
const double error = gpm->pressure_target() - regional_values.pressure(number);
|
||||
double current_rate = 0.0;
|
||||
const auto& pu = well_state.phaseUsage();
|
||||
|
Loading…
Reference in New Issue
Block a user