1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Rethrow MissingDataException when needed

In core/document.js: `PDFDocument.prototype.parse` accesses a dictionary
property, which could throw if the underlying data is not yet available.

In core/obj.js: `get Catalog.prototype.metadata` calls
`stream.getBytes`, which can throw MissingDataException too when the
stream is a ChunkedStream.
This commit is contained in:
Rob Wu 2017-03-22 14:55:59 +01:00
parent 086021b21e
commit 49af56f730
2 changed files with 6 additions and 0 deletions

View file

@ -467,6 +467,9 @@ var PDFDocument = (function PDFDocumentClosure() {
}
}
} catch (ex) {
if (ex instanceof MissingDataException) {
throw ex;
}
info('Something wrong with AcroForm entry');
this.acroForm = null;
}