Skip to content

Commit

Permalink
refactor - fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Milos-RTEi committed Jul 29, 2023
1 parent 96c7eb2 commit 55da260
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ void FinalLevelInflowsModifier::initializeData(const Matrix<double>& scenarioIni
const Data::Parameters& parameters,
uint year)
{
if (!areaPtr)
return;
fillEmpty();
initializeGeneralData(parameters, year);
initializePerAreaData(scenarioInitialHydroLevels, scenarioFinalHydroLevels);
Expand All @@ -145,7 +147,7 @@ void FinalLevelInflowsModifier::initializeData(const Matrix<double>& scenarioIni

bool FinalLevelInflowsModifier::isActive()
{
if (areaPtr->hydro.reservoirManagement && !areaPtr->hydro.useWaterValue
if (areaPtr && areaPtr->hydro.reservoirManagement && !areaPtr->hydro.useWaterValue
&& !isnan(finalReservoirLevel) && !isnan(initialReservoirLevel))
{
return true;
Expand Down

0 comments on commit 55da260

Please sign in to comment.