directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1392051 - /directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
Date Sun, 30 Sep 2012 15:52:12 GMT
Author: elecharny
Date: Sun Sep 30 15:52:11 2012
New Revision: 1392051

URL: http://svn.apache.org/viewvc?rev=1392051&view=rev
Log:
Fixed a NPE : the deletion of a schema was failing if this schema contained no element (DIRSERVER-1718)

Modified:
    directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java

Modified: directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java?rev=1392051&r1=1392050&r2=1392051&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
Sun Sep 30 15:52:11 2012
@@ -282,15 +282,18 @@ public class DefaultSchemaManager implem
 
         List<SchemaObject> toBeDeleted = new ArrayList<SchemaObject>();
 
-        // Buid an intermediate list to avoid concurrent modifications
-        for ( SchemaObjectWrapper schemaObjectWrapper : content )
+        if ( content != null )
         {
-            toBeDeleted.add( schemaObjectWrapper.get() );
-        }
+            // Build an intermediate list to avoid concurrent modifications
+            for ( SchemaObjectWrapper schemaObjectWrapper : content )
+            {
+                toBeDeleted.add( schemaObjectWrapper.get() );
+            }
 
-        for ( SchemaObject schemaObject : toBeDeleted )
-        {
-            registries.delete( errors, schemaObject );
+            for ( SchemaObject schemaObject : toBeDeleted )
+            {
+                registries.delete( errors, schemaObject );
+            }
         }
     }
 



Mime
View raw message