pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1758820 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Date Thu, 01 Sep 2016 17:41:01 GMT
Author: tilman
Date: Thu Sep  1 17:41:01 2016
New Revision: 1758820

URL: http://svn.apache.org/viewvc?rev=1758820&view=rev
Log:
PDFBOX-3479: avoid NPE if no rectangle in widget

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java?rev=1758820&r1=1758819&r2=1758820&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Thu Sep  1 17:41:01 2016
@@ -129,6 +129,10 @@ class AppearanceGeneratorHelper
                     appearanceStream = new PDAppearanceStream(field.getAcroForm().getDocument());
 
                     PDRectangle rect = widget.getRectangle();
+                    if (rect == null)
+                    {
+                        throw new IOException("widget of field " + field.getFullyQualifiedName()
+ " has no rectangle");
+                    }
 
                     // Calculate the entries for the bounding box and the transformation
matrix
                     // settings for the appearance stream



Mime
View raw message