directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r578126 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
Date Fri, 21 Sep 2007 14:09:01 GMT
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 );
+        }
     }
 
     /**



Mime
View raw message