diff --git a/model/map/src/main/java/org/keycloak/models/map/group/MapGroupAdapter.java b/model/map/src/main/java/org/keycloak/models/map/group/MapGroupAdapter.java index 7e5ffaffaf..a5e0ba9719 100644 --- a/model/map/src/main/java/org/keycloak/models/map/group/MapGroupAdapter.java +++ b/model/map/src/main/java/org/keycloak/models/map/group/MapGroupAdapter.java @@ -67,12 +67,7 @@ public class MapGroupAdapter extends AbstractGroupModel { @Override public String getFirstAttribute(String name) { - List attributeValues = this.entity.getAttribute(name); - if (attributeValues == null) { - return null; - } - - return attributeValues.get(0); + return getAttributeStream(name).findFirst().orElse(null); } @Override