From 8da532da93692cce5efbd222a2adce9e00e48378 Mon Sep 17 00:00:00 2001 From: Dane Barentine Date: Mon, 22 Jun 2015 10:46:12 -0700 Subject: [PATCH] [KEYCLOAK-1492] Fix mapClaim when nested attribute already exists --- .../protocol/oidc/mappers/OIDCAttributeMapperHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java b/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java index bae8c08abd..9f29842b78 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java @@ -63,11 +63,13 @@ public class OIDCAttributeMapperHelper { jsonObject.put(split[i], attributeValue); } else { Map nested = (Map)jsonObject.get(split[i]); + if (nested == null) { nested = new HashMap(); jsonObject.put(split[i], nested); - jsonObject = nested; } + + jsonObject = nested; } } }