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 2019/03/26 19:54:15 UTC

svn commit: r1856347 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java

Author: tilman
Date: Tue Mar 26 19:54:15 2019
New Revision: 1856347

URL: http://svn.apache.org/viewvc?rev=1856347&view=rev
Log:
PDFBOX-4495: return COSNull instead of throwing an exception, as suggested by Michael Klink

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java?rev=1856347&r1=1856346&r2=1856347&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java Tue Mar 26 19:54:15 2019
@@ -163,11 +163,13 @@ public abstract class BaseParser
         readExpectedChar('R');
         if (!(value instanceof COSInteger))
         {
-            throw new IOException("expected number, actual=" + value + " at offset " + numOffset);
+            LOG.error("expected number, actual=" + value + " at offset " + numOffset);
+            return COSNull.NULL;
         }
         if (!(generationNumber instanceof COSInteger))
         {
-            throw new IOException("expected number, actual=" + value + " at offset " + genOffset);
+            LOG.error("expected number, actual=" + value + " at offset " + genOffset);
+            return COSNull.NULL;
         }
         COSObjectKey key = new COSObjectKey(((COSInteger) value).longValue(),
                 ((COSInteger) generationNumber).intValue());