Browse Source

Ensure that `PDFDocument.documentInfo` doesn't fail during document load, when the entire XRef table hasn't been fetched yet (issue 8180)

Similar to other `try-catch` statements in `/core` code, we must re-throw `MissingDataException` to prevent issues with missing data during document loading.
Note that I'm not sure if/how we can test this, which is why the patch doesn't include any test(s).

Fixes 8180.
Jonas Jenwald 8 years ago
parent
commit
8527d27eae
  1. 3
      src/core/document.js

3
src/core/document.js

@ -595,6 +595,9 @@ var PDFDocument = (function PDFDocumentClosure() {
try { try {
infoDict = this.xref.trailer.get('Info'); infoDict = this.xref.trailer.get('Info');
} catch (err) { } catch (err) {
if (err instanceof MissingDataException) {
throw err;
}
info('The document information dictionary is invalid.'); info('The document information dictionary is invalid.');
} }
if (infoDict) { if (infoDict) {

Loading…
Cancel
Save