diff --git a/model/jpa/src/main/java/org/keycloak/models/jpa/RoleAdapter.java b/model/jpa/src/main/java/org/keycloak/models/jpa/RoleAdapter.java index 36cea63db1..d80c8bd217 100755 --- a/model/jpa/src/main/java/org/keycloak/models/jpa/RoleAdapter.java +++ b/model/jpa/src/main/java/org/keycloak/models/jpa/RoleAdapter.java @@ -158,13 +158,7 @@ public class RoleAdapter implements RoleModel, JpaModel { @Override public String getFirstAttribute(String name) { - for (RoleAttributeEntity attribute : role.getAttributes()) { - if (attribute.getName().equals(name)) { - return attribute.getValue(); - } - } - - return null; + return getAttributeStream(name).findFirst().orElse(null); } @Override