mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Replace instanceof Object
with typeof
checks
Using `instanceof Object` is generally problematic, since it's not guaranteed to always do the right thing for all Objects. (I stumbled upon this while working on another patch, when I noticed that the `outlineView` was broken with workers disabled.)
This commit is contained in:
parent
d80651e572
commit
909ff8e29f
4 changed files with 7 additions and 3 deletions
|
@ -114,7 +114,7 @@ class PDFLinkService {
|
|||
const destRef = explicitDest[0];
|
||||
let pageNumber;
|
||||
|
||||
if (destRef instanceof Object) {
|
||||
if (typeof destRef === "object" && destRef !== null) {
|
||||
pageNumber = this._cachedPageNumber(destRef);
|
||||
|
||||
if (pageNumber === null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue