Skip to content

Commit

Permalink
12923: Don't try to extract values from an empty weekly storage.
Browse files Browse the repository at this point in the history
  • Loading branch information
iefremov committed Nov 27, 2020
1 parent c6bb0a3 commit 4992d4c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/weekly_storage/weekly_storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ uint64_t WeeklyStorage::GetHighestValueInWeek() const {
[](const auto& left, const auto& right) {
return left.value < right.value;
});
if (highest_it == last_weeks_daily_values.end()) {
return 0;
}
return highest_it->value;
}

Expand Down

0 comments on commit 4992d4c

Please sign in to comment.