From ec7de22dca41221159dd86131cbf8f2689080715 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Sun, 8 May 2022 22:05:58 +0300 Subject: [PATCH] frontend: enforce valid overlays in overlaystore --- frontend/src/stores.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/stores.js b/frontend/src/stores.js index d47f378..826e779 100644 --- a/frontend/src/stores.js +++ b/frontend/src/stores.js @@ -301,11 +301,14 @@ class OverlayStore extends Store { toast: null, login: null, createAccount: null, - settings: null + editMessage: null, + settings: null, }, "OverlayStore"); } open(name, props={}) { + if (this.value[name] === undefined) + throw new Error(`OverlayStore.open: tried to open unknown overlay with name '${name}' (undefined in overlay map)`); this.value[name] = props; this.updated(); }