From 3d1118223b64f86d1c2a7ea4d3f3b10d129eaf28 Mon Sep 17 00:00:00 2001 From: vramik Date: Thu, 21 Apr 2022 09:55:08 +0200 Subject: [PATCH] New Storage: Testsuite fails when JPA Map storage is enabled for groups Closes #11369 --- .../org/keycloak/models/map/group/MapGroupAdapter.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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