Properly handle non-existent link destinations
This commit is contained in:
parent
5f6f3991db
commit
f630b8c519
1 changed files with 2 additions and 0 deletions
|
@ -87,6 +87,8 @@ var PDFView = {
|
||||||
navigateTo: function(dest) {
|
navigateTo: function(dest) {
|
||||||
if (typeof dest === 'string')
|
if (typeof dest === 'string')
|
||||||
dest = this.destinations[dest];
|
dest = this.destinations[dest];
|
||||||
|
if (!(dest instanceof Array))
|
||||||
|
return; // invalid destination
|
||||||
// dest array looks like that: <page-ref> </XYZ|FitXXX> <args..>
|
// dest array looks like that: <page-ref> </XYZ|FitXXX> <args..>
|
||||||
var destRef = dest[0];
|
var destRef = dest[0];
|
||||||
var pageNumber = this.pagesRefMap[destRef.num + ' ' + destRef.gen + ' R'];
|
var pageNumber = this.pagesRefMap[destRef.num + ' ' + destRef.gen + ' R'];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue