diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java index 033b3f40f8..229ac87dd6 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java @@ -117,6 +117,10 @@ public class MSADUserAccountControlMapper extends AbstractLDAPFederationMapper { protected ModelException processFailedPasswordUpdateException(ModelException e) { + if (e.getCause() == null || e.getCause().getMessage() == null) { + return e; + } + String exceptionMessage = e.getCause().getMessage().replace('\n', ' '); Matcher m = AUTH_INVALID_NEW_PASSWORD.matcher(exceptionMessage); if (m.matches()) {