Skip to content

Commit

Permalink
Fix error when map is empty and try to add rating. #32
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzkock committed Jun 23, 2017
1 parent 3e1a5f2 commit d3c6a7c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ public LectureSummaryDto convertToSummaryDto(Lecture lecture) {
}

public void supplyRatings(Collection<LectureSummaryDto> lectures, String userId) {
if (lectures.isEmpty()) {
return;
}
// limitation of IN operator of PostgreSQL
checkArgument(lectures.size() <= 30000, "Cannot supply more than 30,000 ratings at once!");
Map<String, LectureSummaryDto> map = Maps.uniqueIndex(lectures, LectureSummaryDto::getId);
Expand Down

0 comments on commit d3c6a7c

Please sign in to comment.