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 2005/11/21 10:14:34 UTC

svn commit: r345877 - /directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java

Author: elecharny
Date: Mon Nov 21 01:14:14 2005
New Revision: 345877

URL: http://svn.apache.org/viewcvs?rev=345877&view=rev
Log:
- Protect the code from NPE

Modified:
    directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java

Modified: directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java?rev=345877&r1=345876&r2=345877&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java (original)
+++ directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java Mon Nov 21 01:14:14 2005
@@ -31,6 +31,7 @@
 {
     /** the perl 5 regex engine */
     private final Perl5Util perl = new Perl5Util() ;
+    
     /** the set of regular expressions used to transform values*/
     private String [] regexes ;
 
@@ -51,6 +52,11 @@
      */
     public Object normalize( final Object value )
     {
+        if ( value == null )
+        {
+            return null;
+        }
+        
         if ( value instanceof String )
         {
             String str = ( String ) value ;