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:
Jonas Jenwald 2021-07-03 11:15:13 +02:00
parent d80651e572
commit 909ff8e29f
4 changed files with 7 additions and 3 deletions

View file

@ -304,7 +304,7 @@ class PDFOutlineViewer extends BaseTreeViewer {
if (Array.isArray(explicitDest)) {
const [destRef] = explicitDest;
if (destRef instanceof Object) {
if (typeof destRef === "object" && destRef !== null) {
pageNumber = this.linkService._cachedPageNumber(destRef);
if (!pageNumber) {