[ts] Better error when parent element is not found.

This commit is contained in:
Nathan Sweet 2021-07-19 16:58:17 -04:00
parent 43acb097e5
commit 1bde7527c9

View File

@ -217,6 +217,7 @@ module spine {
constructor (parent: HTMLElement | string, private config: SpinePlayerConfig) {
this.parent = typeof parent === "string" ? document.getElementById(parent) : parent;
if (!this.parent) throw new Error("SpinePlayer parent not found: " + parent);
if (config.showControls === void 0) config.showControls = true;
let controls = config.showControls ? /*html*/`