mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +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:
parent
086021b21e
commit
49af56f730
2 changed files with 6 additions and 0 deletions
|
@ -104,6 +104,9 @@ var Catalog = (function CatalogClosure() {
|
|||
try {
|
||||
metadata = stringToUTF8String(bytesToString(stream.getBytes()));
|
||||
} catch (e) {
|
||||
if (e instanceof MissingDataException) {
|
||||
throw e;
|
||||
}
|
||||
info('Skipping invalid metadata.');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue