pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1369092 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java
Date Fri, 03 Aug 2012 16:30:48 GMT
Author: lehmi
Date: Fri Aug  3 16:30:47 2012
New Revision: 1369092

URL: http://svn.apache.org/viewvc?rev=1369092&view=rev
Log:
PDFBOX-1378: avoid NPE as proposed by Dominic Tubach

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java?rev=1369092&r1=1369091&r2=1369092&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java Fri Aug  3 16:30:47
2012
@@ -303,8 +303,15 @@ public class COSArray extends COSBase im
      */
     public void setString( int index, String string )
     {
-        set( index, new COSString( string ) );
-    }
+        if ( string != null )
+        {
+            set( index, new COSString( string ) );
+        }
+        else
+        {
+            set ( index, null );
+        }
+    }   
 
     /**
      * Get the value of the array as a string.



Mime
View raw message