Missing null check for session.userCache() added
NPE when existing user from LDAP is found (same LDAP_ID, but with changed username) and session.userCache() is null.
This commit is contained in:
parent
1ad34c6ab0
commit
b4536a394a
1 changed files with 3 additions and 1 deletions
|
@ -525,7 +525,9 @@ public class LDAPStorageProvider implements UserStorageProvider,
|
|||
if(existingLocalUser != null){
|
||||
imported = existingLocalUser;
|
||||
// Need to evict the existing user from cache
|
||||
session.userCache().evict(realm, existingLocalUser);
|
||||
if (session.userCache() != null) {
|
||||
session.userCache().evict(realm, existingLocalUser);
|
||||
}
|
||||
} else {
|
||||
imported = session.userLocalStorage().addUser(realm, ldapUsername);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue