lightbox_canvas: Make parameter type error fatal.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-07-23 01:16:47 -07:00
committed by Tim Abbott
parent c4024e30c2
commit d5a0ee612f

View File

@@ -281,8 +281,7 @@ const LightboxCanvas = function (el) {
} else if (typeof el === "string") { } else if (typeof el === "string") {
this.canvas = document.querySelector(el); this.canvas = document.querySelector(el);
} else { } else {
blueslip.warn("Error. 'LightboxCanvas' accepts either string selector or node."); throw new TypeError("'LightboxCanvas' accepts either string selector or node.");
return;
} }
this.context = this.canvas.getContext("2d"); this.context = this.canvas.getContext("2d");