You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2007/09/21 16:09:01 UTC

svn commit: r578126 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java

Author: elecharny
Date: Fri Sep 21 07:09:01 2007
New Revision: 578126

URL: http://svn.apache.org/viewvc?rev=578126&view=rev
Log:
Added some defensive code to avoid NPE if the attrsId is null

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java?rev=578126&r1=578125&r2=578126&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java Fri Sep 21 07:09:01 2007
@@ -92,8 +92,15 @@
      */
     public String[] getAttrsIdArray()
     {
-        String[] attrs = new String[ attrsId.size()];
-        return attrsId.toArray( attrs );
+        if ( attrsId == null )
+        {
+            return new String[]{};
+        }
+        else
+        {
+            String[] attrs = new String[ attrsId.size()];
+            return attrsId.toArray( attrs );
+        }
     }
 
     /**