KEYCLOAK-19289 check if values to set is not null (#8426)

Closes #9529
This commit is contained in:
Dominik DS 2022-01-12 09:22:01 +01:00 committed by GitHub
parent 1ff558bd9e
commit 93419a1797
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -175,8 +175,10 @@ public class UserAdapter implements UserModel.Streams, JpaModel<UserEntity> {
}
// Remove all existing
removeAttribute(name);
for (Iterator<String> it = values.stream().filter(Objects::nonNull).iterator(); it.hasNext();) {
persistAttributeValue(name, it.next());
if (values != null) {
for (Iterator<String> it = values.stream().filter(Objects::nonNull).iterator(); it.hasNext();) {
persistAttributeValue(name, it.next());
}
}
}