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.
This commit is contained in:
Jonas Jenwald 2017-03-22 14:02:34 +01:00
parent e2e13df4a5
commit 8527d27eae

View File

@ -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) {