Skip to content

Commit 4dc6237

Browse files
committed
[smartcharging] Fix error management when computing periods of a composite schedule
1 parent a3675d8 commit 4dc6237

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/chargepoint/smartcharging/SmartChargingManager.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ bool SmartChargingManager::handleMessage(const ocpp::messages::GetCompositeSched
375375

376376
// Compute periods
377377
std::vector<Period> periods;
378-
DateTime now = DateTime::now();
378+
bool error = false;
379+
DateTime now = DateTime::now();
379380
for (auto& profile_list : profile_lists)
380381
{
381382
unsigned int stack_level = std::numeric_limits<unsigned int>::max();
@@ -390,11 +391,11 @@ bool SmartChargingManager::handleMessage(const ocpp::messages::GetCompositeSched
390391
stack_level = profile.second.stackLevel;
391392
if (periods.empty())
392393
{
393-
break;
394+
error = true;
394395
}
395396
}
396397
}
397-
if (periods.empty())
398+
if (error)
398399
{
399400
break;
400401
}

0 commit comments

Comments
 (0)