Skip to content

Commit

Permalink
G2-1618 Avoid NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
gdgib committed Dec 25, 2024
1 parent 4ee0077 commit e9aba60
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.g2forge.alexandria.java.core.helpers.HCollection;
Expand Down Expand Up @@ -63,7 +64,7 @@ public List<CreateIssue> getDisabledIssues() {
}

public void validateFlags() {
final Set<String> referencedFlags = getIssues().stream().flatMap(issue -> issue.getFlags().stream()).collect(Collectors.toSet());
final Set<String> referencedFlags = getIssues().stream().flatMap(issue -> issue.getFlags() == null ? Stream.empty() : issue.getFlags().stream()).collect(Collectors.toSet());
final Set<String> unknownFlags = HCollection.difference(referencedFlags, getSpecifiedFlags().keySet());
if (!unknownFlags.isEmpty()) throw new IllegalArgumentException("The following flags are refenced by issues, but are neither enabled nor disabled: " + unknownFlags.stream().collect(HCollector.joining(", ", ", & ")));
}
Expand Down

0 comments on commit e9aba60

Please sign in to comment.