From: notmasteryet Date: Sat, 27 Aug 2011 03:58:03 +0000 (-0500) Subject: Properly handle non-existent link destinations X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f630b8c519cf6e98f1fdd283da0b693ada88374e;p=pdf.js.git Properly handle non-existent link destinations --- diff --git a/web/viewer.js b/web/viewer.js index 8af6e01..ec7ff30 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -87,6 +87,8 @@ var PDFView = { navigateTo: function(dest) { if (typeof dest === 'string') dest = this.destinations[dest]; + if (!(dest instanceof Array)) + return; // invalid destination // dest array looks like that: var destRef = dest[0]; var pageNumber = this.pagesRefMap[destRef.num + ' ' + destRef.gen + ' R'];