Fix issue with empty description in OpenLDAP
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.ldap / src / main / java / org / argeo / security / ldap / jcr / JcrUserDetailsContextMapper.java
index 3a39e690627712d3379d90b1c65638e05c2ec6e8..7e2d89e6d62805adaf15f424cf8fecedc099fbd6 100644 (file)
@@ -208,6 +208,12 @@ public class JcrUserDetailsContextMapper implements UserDetailsContextMapper,
                                                        .equals("")))
                                userProfile.setProperty(jcrProperty, "empty");
 
+                       if (ldapAttribute.equals("description")) {
+                               String value = userProfile.getProperty(jcrProperty).getString();
+                               if(value.trim().equals(""))
+                                       return;
+                       }
+
                        if (!userProfile.hasProperty(jcrProperty))
                                return;
                        String value = userProfile.getProperty(jcrProperty).getString();