pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1633897 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
Date Thu, 23 Oct 2014 17:39:38 GMT
Author: lehmi
Date: Thu Oct 23 17:39:38 2014
New Revision: 1633897

URL: http://svn.apache.org/r1633897
Log:
PDFBOX-1273: skip null references within an annotation array to avoid IOException as proposed
by William 

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java?rev=1633897&r1=1633896&r2=1633897&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java Thu Oct 23 17:39:38
2014
@@ -741,6 +741,11 @@ public class PDPage implements COSObject
             for (int i = 0; i < annots.size(); i++)
             {
                 COSBase item = annots.getObject(i);
+            	if (item == null)
+            	{
+            		LOG.debug("Skipped annotation due to a null reference.");
+            		continue;
+            	}
                 actuals.add(PDAnnotation.createAnnotation(item));
             }
             retval = new COSArrayList<PDAnnotation>(actuals, annots);



Mime
View raw message