pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1750728 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
Date Wed, 29 Jun 2016 21:21:05 GMT
Author: tilman
Date: Wed Jun 29 21:21:05 2016
New Revision: 1750728

URL: http://svn.apache.org/viewvc?rev=1750728&view=rev
Log:
PDFBOX-2854: avoid NPE for missing post table

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java?rev=1750728&r1=1750727&r2=1750728&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java Wed Jun 29
21:21:05 2016
@@ -577,10 +577,13 @@ public class TrueTypeFont implements Fon
     {
         // look up in 'post' table
         readPostScriptNames();
-        Integer gid = postScriptNames.get(name);
-        if (gid != null && gid > 0 && gid < getMaximumProfile().getNumGlyphs())
+        if (postScriptNames != null)
         {
-            return gid;
+            Integer gid = postScriptNames.get(name);
+            if (gid != null && gid > 0 && gid < getMaximumProfile().getNumGlyphs())
+            {
+                return gid;
+            }
         }
 
         // look up in 'cmap'



Mime
View raw message