Check iterator for it != cfg->TimeRange.cend().
This commit is contained in:
parent
e93b08505a
commit
ea0bcde413
@ -408,7 +408,10 @@ uint32_t Utilities::getMaximalParkingPrice(Configuration const *cfg, PaymentMeth
|
|||||||
|
|
||||||
uint32_t Utilities::getTimeRangeStep(Configuration const *cfg, int step, PaymentMethod methodId) {
|
uint32_t Utilities::getTimeRangeStep(Configuration const *cfg, int step, PaymentMethod methodId) {
|
||||||
if (methodId == PaymentMethod::Progressive) {
|
if (methodId == PaymentMethod::Progressive) {
|
||||||
return std::max((int)cfg->TimeRange.find(step)->second.time_range_to_in_minutes_from_start, 0);
|
Configuration::TimeRangeType::const_iterator it = cfg->TimeRange.find(step);
|
||||||
|
if (it != cfg->TimeRange.cend()) {
|
||||||
|
return std::max((int)(it->second.time_range_to_in_minutes_from_start), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user