]> git.parisson.com Git - pdf.js.git/commitdiff
Properly handle non-existent link destinations
authornotmasteryet <async.processingjs@yahoo.com>
Sat, 27 Aug 2011 03:58:03 +0000 (22:58 -0500)
committernotmasteryet <async.processingjs@yahoo.com>
Sat, 27 Aug 2011 03:58:03 +0000 (22:58 -0500)
web/viewer.js

index 8af6e01d1073532fa203e9d6912b68b1c71a8440..ec7ff3001bc2fba4370dbe6293760bf0dd687d5c 100644 (file)
@@ -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: <page-ref> </XYZ|FitXXX> <args..>
     var destRef = dest[0];
     var pageNumber = this.pagesRefMap[destRef.num + ' ' + destRef.gen + ' R'];