Fix arbitrary access to reminder list.

This commit is contained in:
jude
2023-07-23 14:29:59 +01:00
parent 4a17aac15c
commit 01dc0334fd
2 changed files with 18 additions and 2 deletions

View File

@ -427,6 +427,14 @@ document.addEventListener("guildSwitched", async (e) => {
`.switch-pane[data-guild="${e.detail.guild_id}"]`
);
let hasError = false;
if ($anchor === null) {
switch_pane("user-error");
hasError = true;
return;
}
switch_pane($anchor.dataset["pane"]);
reset_guild_pane();
$anchor.classList.add("is-active");
@ -437,7 +445,7 @@ document.addEventListener("guildSwitched", async (e) => {
.forEach((el) => el.classList.remove("is-locked"));
}
let hasError = await fetch_channels(e.detail.guild_id);
hasError = await fetch_channels(e.detail.guild_id);
if (!hasError) {
fetch_roles(e.detail.guild_id);
fetch_templates(e.detail.guild_id);