pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1832634 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Date Thu, 31 May 2018 18:07:19 GMT
Author: tilman
Date: Thu May 31 18:07:19 2018
New Revision: 1832634

URL: http://svn.apache.org/viewvc?rev=1832634&view=rev
Log:
PDFBOX-4235: avoid NPE if font is not defined in /DA string

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=1832634&r1=1832633&r2=1832634&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 May 31 18:07:19 2018
@@ -411,6 +411,10 @@ class AppearanceGeneratorHelper
         
         // get the font
         PDFont font = defaultAppearance.getFont();
+        if (font == null)
+        {
+            throw new IllegalStateException("font is null, check whether /DA entry is incomplete
or incorrect");
+        }
         
         // calculate the fontSize (because 0 = autosize)
         float fontSize = defaultAppearance.getFontSize();



Mime
View raw message