pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1782034 - /pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java
Date Tue, 07 Feb 2017 17:03:49 GMT
Author: tilman
Date: Tue Feb  7 17:03:49 2017
New Revision: 1782034

URL: http://svn.apache.org/viewvc?rev=1782034&view=rev
Log:
PDFBOX-3677: avoid NPE

Modified:
    pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java

Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java?rev=1782034&r1=1782033&r2=1782034&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java (original)
+++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java Tue
Feb  7 17:03:49 2017
@@ -758,7 +758,7 @@ final class Type1Parser
     private Token read(Token.Kind kind) throws IOException
     {
         Token token = lexer.nextToken();
-        if (token.getKind() != kind)
+        if (token == null || token.getKind() != kind)
         {
             throw new IOException("Found " + token + " but expected " + kind);
         }
@@ -772,7 +772,7 @@ final class Type1Parser
     private void read(Token.Kind kind, String name) throws IOException
     {
         Token token = read(kind);
-        if (!token.getText().equals(name))
+        if (token == null || !token.getText().equals(name))
         {
             throw new IOException("Found " + token + " but expected " + name);
         }



Mime
View raw message