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; } } }