Skip to content

Commit

Permalink
[backend] Avoid NPE on calculate results
Browse files Browse the repository at this point in the history
Co-authored-by: Stephanya Casanova <[email protected]>
  • Loading branch information
RomuDeuxfois and savacano28 authored Oct 30, 2024
1 parent c520d6b commit 79b8230
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,9 @@ public static List<InjectTargetWithResult> getTargetsWithResultsFromRaw(
// -- PRE CALCULATED RESULTS FOR PLAYERS --
private static List<InjectTargetWithResult> calculateResultsforPlayers(
Map<User, List<InjectExpectation>> expectationsByUser) {
if (expectationsByUser == null) {
return new ArrayList<>();
}
return expectationsByUser.entrySet().stream()
.map(
userEntry ->
Expand All @@ -747,6 +750,9 @@ private static List<InjectTargetWithResult> calculateResultsforPlayers(

private static List<InjectTargetWithResult> calculateResultsforPlayersFromRaw(
Map<String, List<RawInjectExpectation>> expectationsByUser, Map<String, RawUser> rawUserMap) {
if (expectationsByUser == null) {
return new ArrayList<>();
}
return expectationsByUser.entrySet().stream()
.map(
userEntry ->
Expand Down

0 comments on commit 79b8230

Please sign in to comment.