mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #1899 from benbro/master
Catch errors when parsing the localization header.
This commit is contained in:
commit
9c012f8a4d
1 changed files with 8 additions and 3 deletions
11
src/core.js
11
src/core.js
|
@ -399,9 +399,14 @@ var PDFDocument = (function PDFDocumentClosure() {
|
|||
var length = this.stream.length;
|
||||
var linearization = false;
|
||||
if (length) {
|
||||
linearization = new Linearization(this.stream);
|
||||
if (linearization.length != length)
|
||||
linearization = false;
|
||||
try {
|
||||
linearization = new Linearization(this.stream);
|
||||
if (linearization.length != length)
|
||||
linearization = false;
|
||||
} catch (err) {
|
||||
warn('The linearization data is not available ' +
|
||||
'or unreadable pdf data is found');
|
||||
}
|
||||
}
|
||||
// shadow the prototype getter with a data property
|
||||
return shadow(this, 'linearization', linearization);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue