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