directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r225418 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java
Date Tue, 26 Jul 2005 23:35:40 GMT
Author: elecharny
Date: Tue Jul 26 16:35:36 2005
New Revision: 225418

URL: http://svn.apache.org/viewcvs?rev=225418&view=rev
Log:
Added a test to avoid a NPE when having a null string

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java?rev=225418&r1=225417&r2=225418&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java
Tue Jul 26 16:35:36 2005
@@ -54,6 +54,11 @@
      */
     public LdapString( byte[] bytes ) throws DecoderException
     {
+        if ( bytes == null )
+        {
+            return;
+        }
+        
         int stringLength = StringUtils.countChars(bytes);
         
         setData(bytes);



Mime
View raw message