avoid NPE in LegacyAttributes when using federated storage
Closes #https://github.com/keycloak/keycloak/issues/15482
This commit is contained in:
parent
21cce0a1d3
commit
993d910520
1 changed files with 3 additions and 9 deletions
|
@ -40,16 +40,10 @@ public class LegacyAttributes extends DefaultAttributes {
|
|||
|
||||
@Override
|
||||
public Map<String, List<String>> getReadable() {
|
||||
if(user == null)
|
||||
return null;
|
||||
if(user == null || user.getAttributes() == null)
|
||||
return new HashMap<>();
|
||||
|
||||
Map<String, List<String>> attributes = new HashMap<>(user.getAttributes());
|
||||
|
||||
if (attributes.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return attributes;
|
||||
return new HashMap<>(user.getAttributes());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue