From 1bde7527c91a1a1ae4a4af5cd2efa4c07cb64248 Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Mon, 19 Jul 2021 16:58:17 -0400 Subject: [PATCH] [ts] Better error when parent element is not found. --- spine-ts/player/src/Player.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/spine-ts/player/src/Player.ts b/spine-ts/player/src/Player.ts index b19d501e8..3361b8382 100644 --- a/spine-ts/player/src/Player.ts +++ b/spine-ts/player/src/Player.ts @@ -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*/`