Skip to content

Commit 278dc81

Browse files
committed
Move the try/catch block deeper
1 parent 9de9499 commit 278dc81

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,16 +398,16 @@ var PDFDocument = (function PDFDocumentClosure() {
398398
get linearization() {
399399
var length = this.stream.length;
400400
var linearization = false;
401-
try {
402-
if (length) {
401+
if (length) {
402+
try {
403403
linearization = new Linearization(this.stream);
404404
if (linearization.length != length)
405405
linearization = false;
406+
} catch (err) {
407+
warn('since pdf is broken pdf.js is trying to recover it ' +
408+
'by indexing the object; ' +
409+
'the error in firebug shall have a different origin');
406410
}
407-
} catch (err) {
408-
warn('since pdf is broken pdf.js is trying to recover it ' +
409-
'by indexing the object; ' +
410-
'the error in firebug shall have a different origin');
411411
}
412412
// shadow the prototype getter with a data property
413413
return shadow(this, 'linearization', linearization);

0 commit comments

Comments
 (0)