directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r491702 - /directory/trunks/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/DnComparator.java
Date Mon, 01 Jan 2007 23:31:01 GMT
Author: elecharny
Date: Mon Jan  1 15:31:00 2007
New Revision: 491702

URL: http://svn.apache.org/viewvc?view=rev&rev=491702
Log:
Added a safety net against potential NPE

Modified:
    directory/trunks/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/DnComparator.java

Modified: directory/trunks/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/DnComparator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/DnComparator.java?view=diff&rev=491702&r1=491701&r2=491702
==============================================================================
--- directory/trunks/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/DnComparator.java
(original)
+++ directory/trunks/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/DnComparator.java
Mon Jan  1 15:31:00 2007
@@ -81,6 +81,7 @@
     public LdapDN getDn( Object obj ) throws NamingException
     {
         LdapDN dn = null;
+        
         if ( obj instanceof LdapDN )
         {
             dn = LdapDN.normalize( ( LdapDN ) obj, attrRegistry.getNormalizerMapping() );
@@ -98,8 +99,9 @@
         else
         {
             throw new IllegalStateException( "I do not know how to handle dn comparisons
with objects of class: " 
-                + obj.getClass() );
+                + (obj == null ? null : obj.getClass() ) );
         }
+        
         return dn;
     }
 }



Mime
View raw message