Skip to content

Commit

Permalink
fix NPEs in StepResult.merge
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceWalkerRS committed Jun 16, 2024
1 parent 5ca1172 commit 2075675
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ public enum StepResult implements Comparator<StepResult> {
FAILED;

public static StepResult merge(StepResult... results) {
return Arrays.stream(results).max(StepResult::compareTo).orElse(NOT_RUN);
return Arrays.stream(results).filter(r -> r != null).max(StepResult::compareTo).orElse(NOT_RUN);
}

public static StepResult merge(Collection<StepResult> results) {
return results.stream().max(StepResult::compareTo).orElse(NOT_RUN);
return results.stream().filter(r -> r != null).max(StepResult::compareTo).orElse(NOT_RUN);
}

@Override
Expand Down

0 comments on commit 2075675

Please sign in to comment.