X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=security%2Fruntime%2Forg.argeo.security.ldap%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fsecurity%2Fldap%2Fjcr%2FJcrLdapSynchronizer.java;fp=security%2Fruntime%2Forg.argeo.security.ldap%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fsecurity%2Fldap%2Fjcr%2FJcrLdapSynchronizer.java;h=0f59f1ee528c11561e8d9a67b6d4a3c13bb4b1d0;hb=f763d5bc49fa5cae85e85ca8ae69f51d10a86060;hp=3a644a6939209abb0213837c747fb72aedc04928;hpb=ed8fd37cd3f0ba784ac292668abfc00c66674293;p=lgpl%2Fargeo-commons.git diff --git a/security/runtime/org.argeo.security.ldap/src/main/java/org/argeo/security/ldap/jcr/JcrLdapSynchronizer.java b/security/runtime/org.argeo.security.ldap/src/main/java/org/argeo/security/ldap/jcr/JcrLdapSynchronizer.java index 3a644a693..0f59f1ee5 100644 --- a/security/runtime/org.argeo.security.ldap/src/main/java/org/argeo/security/ldap/jcr/JcrLdapSynchronizer.java +++ b/security/runtime/org.argeo.security.ldap/src/main/java/org/argeo/security/ldap/jcr/JcrLdapSynchronizer.java @@ -336,9 +336,12 @@ public class JcrLdapSynchronizer implements UserDetailsContextMapper, Node userProfile = securitySession.getNode( jcrUserDetails.getHomePath()).getNode(ARGEO_PROFILE); for (String jcrProperty : propertyToAttributes.keySet()) { - ModificationItem mi = jcrToLdap(jcrProperty, userProfile - .getProperty(jcrProperty).getString()); - ctx.setAttribute(mi.getAttribute()); + if (userProfile.hasProperty(jcrProperty)) { + ModificationItem mi = jcrToLdap(jcrProperty, userProfile + .getProperty(jcrProperty).getString()); + if (mi != null) + ctx.setAttribute(mi.getAttribute()); + } } if (log.isTraceEnabled()) log.trace("Mapped " + userProfile + " to " + ctx.getDn());