You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2017/09/18 21:32:25 UTC
svn commit: r1808781 -
/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
Author: tilman
Date: Mon Sep 18 21:32:25 2017
New Revision: 1808781
URL: http://svn.apache.org/viewvc?rev=1808781&view=rev
Log:
PDFBOX-3937: avoid NPE
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java?rev=1808781&r1=1808780&r2=1808781&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java Mon Sep 18 21:32:25 2017
@@ -93,21 +93,23 @@ public class PDCIDFontType2 extends PDCI
boolean fontIsDamaged = false;
TrueTypeFont ttfFont = null;
- PDStream stream;
- if (fd.getFontFile2() != null)
+ PDStream stream = null;
+ if (fd != null)
{
- stream = fd.getFontFile2();
+ if (fd.getFontFile2() != null)
+ {
+ stream = fd.getFontFile2();
+ }
+ else if (fd.getFontFile3() != null)
+ {
+ stream = fd.getFontFile3();
+ }
+ else
+ {
+ // Acrobat looks in FontFile too, even though it is not in the spec, see PDFBOX-2599
+ stream = fd.getFontFile();
+ }
}
- else if (fd.getFontFile3() != null)
- {
- stream = fd.getFontFile3();
- }
- else
- {
- // Acrobat looks in FontFile too, even though it is not in the spec, see PDFBOX-2599
- stream = fd.getFontFile();
- }
-
if (stream != null)
{
try