Merge pull request #12388 from jsg2021/patch-1

Refactor the container/viewer checks in the BaseViewer constructor
This commit is contained in:
Tim van der Meij 2020-09-17 23:05:18 +02:00 committed by GitHub
commit 802b4c0850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,8 +150,10 @@ class BaseViewer {
) {
if (
!(
this.container instanceof HTMLDivElement &&
this.viewer instanceof HTMLDivElement
this.container &&
this.container.tagName.toUpperCase() === "DIV" &&
this.viewer &&
this.viewer.tagName.toUpperCase() === "DIV"
)
) {
throw new Error("Invalid `container` and/or `viewer` option.");