From 278dc81a5404377889af7f6ecaf4bebb7e4b7304 Mon Sep 17 00:00:00 2001 From: benbro Date: Fri, 13 Jul 2012 18:00:55 +0300 Subject: [PATCH] Move the try/catch block deeper --- src/core.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core.js b/src/core.js index 5faac7621..46c265298 100644 --- a/src/core.js +++ b/src/core.js @@ -398,16 +398,16 @@ var PDFDocument = (function PDFDocumentClosure() { get linearization() { var length = this.stream.length; var linearization = false; - try { - if (length) { + if (length) { + try { linearization = new Linearization(this.stream); if (linearization.length != length) 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 return shadow(this, 'linearization', linearization);