Skip to content

Commit

Permalink
npe fixes while authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Mar 28, 2023
1 parent 595816c commit b3ba2af
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,15 @@ private boolean allModulesAreProcessed() {
private boolean atLeastOneSuccessfulModuleExists() {
return sequence.getModule()
.stream()
.anyMatch(m -> AuthenticationModuleState.SUCCESSFULLY.equals(getAuthenticationByIdentifier(m).getState()));
.anyMatch(m -> getAuthenticationByIdentifier(m) != null &&
AuthenticationModuleState.SUCCESSFULLY.equals(getAuthenticationByIdentifier(m).getState()));
}

private boolean allModulesStateMatch(AuthenticationModuleState... states) {
return sequence.getModule()
.stream()
.allMatch(m -> Arrays.stream(states).anyMatch(s -> s.equals(getAuthenticationByIdentifier(m).getState())));
.allMatch(m -> Arrays.stream(states).anyMatch(s ->
getAuthenticationByIdentifier(m) != null && s.equals(getAuthenticationByIdentifier(m).getState())));
}

private boolean getRequiredModulesDecision() {
Expand Down

0 comments on commit b3ba2af

Please sign in to comment.