From d49ad41a689c998aff0fd53e5c3dee28a2b5fb1b Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 30 May 2024 10:07:59 -0700 Subject: [PATCH] settings_emoji: Fix TypeScript noUncheckedIndexedAccess errors. Signed-off-by: Anders Kaseorg --- web/src/settings_emoji.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/settings_emoji.ts b/web/src/settings_emoji.ts index f004c75ce3..1a7d4d676f 100644 --- a/web/src/settings_emoji.ts +++ b/web/src/settings_emoji.ts @@ -221,6 +221,7 @@ function show_modal(): void { const emoji: Record = {}; function submit_custom_emoji_request(formData: FormData): void { + assert(emoji.name !== undefined); void channel.post({ url: "/json/realm/emoji/" + encodeURIComponent(emoji.name), data: formData, @@ -241,6 +242,7 @@ function show_modal(): void { for (const obj of $("#add-custom-emoji-form").serializeArray()) { emoji[obj.name] = obj.value; } + assert(emoji.name !== undefined); if (emoji.name.trim() === "") { ui_report.client_error(