directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r546021 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Date Mon, 11 Jun 2007 05:36:17 GMT
Author: elecharny
Date: Sun Jun 10 22:36:16 2007
New Revision: 546021

URL: http://svn.apache.org/viewvc?view=rev&rev=546021
Log:
Fixed a NPE when the user send an Attributes without any "ObjecClass" attribute

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=546021&r1=546020&r2=546021
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Sun Jun 10 22:36:16 2007
@@ -1687,6 +1687,15 @@
         // 3-2) or if the AttributeType is COLLECTIVE
         // 4) We also check that for H-R attributes, we have a valid String in the values
         Attribute objectClassAttr = entry.get( SchemaConstants.OBJECT_CLASS_AT );
+        
+        // Protect the server against a null objectClassAttr
+        // It can be the case if the user forgot to add it to the entry ...
+        // In this case, we create an new one, empty
+        if ( objectClassAttr == null )
+        {
+            objectClassAttr = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
+        }
+        
         List<ObjectClass> ocs = new ArrayList<ObjectClass>();
 
         alterObjectClasses( objectClassAttr );



Mime
View raw message