Skip to content

Commit 460f804

Browse files
committed
PDFBOX-6187: avoid NPE
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1932849 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4463ecf commit 460f804

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,12 @@ private void insertGeneratedAppearance(PDAnnotationWidget widget, PDAppearanceSt
490490

491491
// get the font
492492
PDFont font = defaultAppearance.getFont();
493-
if (font == null) {
493+
if (font == null)
494+
{
494495
throw new IllegalArgumentException("font is null, check whether /DA entry is incomplete or incorrect");
495496
}
496-
if (font.getName().contains("+")) {
497+
if (font.getName() != null && font.getName().contains("+"))
498+
{
497499
LOG.warn("Font '" + defaultAppearance.getFontName().getName() + "' of field '"
498500
+ field.getFullyQualifiedName() + "' contains subsetted font '" + font.getName() + "'");
499501
LOG.warn("This may bring trouble with PDField.setValue(), PDAcroForm.flatten() or "

0 commit comments

Comments
 (0)