pdfbox-commits mailing list archives

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

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

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java?rev=1832635&r1=1832634&r2=1832635&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Thu May 31 18:07:26 2018
@@ -411,7 +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