Properly handle non-existent link destinations

This commit is contained in:
notmasteryet 2011-08-26 22:58:03 -05:00
parent 5f6f3991db
commit f630b8c519

View 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'];