mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Prevent errors, in PDFOutlineViewer._getPageNumberToDestHash
, for invalid destRef
values (PR 12777 follow-up)
Currently `destRef === null`, which will only happen in documents with corrupt destinations, will (unsurprisingly) throw when trying to lookup the pageNumber. To avoid this, we can simply use the same format as in 1a2cdaffc5/web/pdf_link_service.js (L128)
This commit is contained in:
parent
1a2cdaffc5
commit
14fc9db73d
1 changed files with 1 additions and 1 deletions
|
@ -276,7 +276,7 @@ class PDFOutlineViewer extends BaseTreeViewer {
|
|||
if (Array.isArray(explicitDest)) {
|
||||
const [destRef] = explicitDest;
|
||||
|
||||
if (typeof destRef === "object") {
|
||||
if (destRef instanceof Object) {
|
||||
pageNumber = this.linkService._cachedPageNumber(destRef);
|
||||
|
||||
if (!pageNumber) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue