directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r697059 - /directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
Date Fri, 19 Sep 2008 11:30:53 GMT
Author: elecharny
Date: Fri Sep 19 04:30:53 2008
New Revision: 697059

URL: http://svn.apache.org/viewvc?rev=697059&view=rev
Log:
Avoid a NPE when the entry is not found. Thiw will fix DIRSERVER-1267

Modified:
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java?rev=697059&r1=697058&r2=697059&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
(original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
Fri Sep 19 04:30:53 2008
@@ -97,6 +97,14 @@
     {
         LdapDN effectiveBase;
         Long baseId = db.getEntryId( base.toString() );
+        
+        // Check that we have an entry, otherwise we can immediately get out
+        if ( baseId == null )
+        {
+            // The entry is not found : ciao !
+            return new EmptyIndexCursor<Long, ServerEntry>();
+        }
+        
         String aliasedBase = db.getAliasIndex().reverseLookup( baseId );
 
         // --------------------------------------------------------------------



Mime
View raw message