Improve Directory framework.
[lgpl/argeo-commons.git] / org.argeo.util / src / org / argeo / util / directory / ldap / LdapDao.java
index fac7dd1acf582bb47d7b080bdf70fb8f9cf09b8c..b1c0c9849a14cb6abdd5214ad239912e591d887f 100644 (file)
@@ -278,6 +278,8 @@ public class LdapDao extends AbstractLdapDirectoryDao {
                                throw new IllegalArgumentException(dn + " does not start with base DN " + getDirectory().getBaseDn());
                        Attributes attrs = ldapConnection.getAttributes(dn);
                        return new LdapHierarchyUnit(getDirectory(), dn, attrs);
+               } catch (NameNotFoundException e) {
+                       return null;
                } catch (NamingException e) {
                        throw new IllegalStateException("Cannot get hierarchy unit " + dn, e);
                }