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:
Jonas Jenwald 2021-03-28 17:36:51 +02:00
parent 1a2cdaffc5
commit 14fc9db73d

View File

@ -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) {