mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Move the try/catch block deeper
This commit is contained in:
parent
9de94991e9
commit
278dc81a54
1 changed files with 6 additions and 6 deletions
12
src/core.js
12
src/core.js
|
@ -398,16 +398,16 @@ var PDFDocument = (function PDFDocumentClosure() {
|
||||||
get linearization() {
|
get linearization() {
|
||||||
var length = this.stream.length;
|
var length = this.stream.length;
|
||||||
var linearization = false;
|
var linearization = false;
|
||||||
try {
|
if (length) {
|
||||||
if (length) {
|
try {
|
||||||
linearization = new Linearization(this.stream);
|
linearization = new Linearization(this.stream);
|
||||||
if (linearization.length != length)
|
if (linearization.length != length)
|
||||||
linearization = false;
|
linearization = false;
|
||||||
|
} catch (err) {
|
||||||
|
warn('since pdf is broken pdf.js is trying to recover it ' +
|
||||||
|
'by indexing the object; ' +
|
||||||
|
'the error in firebug shall have a different origin');
|
||||||
}
|
}
|
||||||
} catch (err) {
|
|
||||||
warn('since pdf is broken pdf.js is trying to recover it ' +
|
|
||||||
'by indexing the object; ' +
|
|
||||||
'the error in firebug shall have a different origin');
|
|
||||||
}
|
}
|
||||||
// shadow the prototype getter with a data property
|
// shadow the prototype getter with a data property
|
||||||
return shadow(this, 'linearization', linearization);
|
return shadow(this, 'linearization', linearization);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue