Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

hotkey: Fix wrong assumption of message_lists.current is defined.

Aman Agrawal97452ea4f89c
diff --git a/web/src/hotkey.ts b/web/src/hotkey.ts
index 328b3d9391a..1f03cc0927f 100644
--- a/web/src/hotkey.ts
+++ b/web/src/hotkey.ts
@@ -1207,9 +1207,9 @@ function process_hotkey(e: JQuery.KeyDownEvent, hotkey: Hotkey): boolean {
if (inbox_ui.is_in_focus()) {
return inbox_ui.toggle_topic_visibility_policy();
}
- if (message_lists.current!.selected_message()) {
+ if (message_lists.current?.selected_message()) {
user_topics_ui.toggle_topic_visibility_policy(
- message_lists.current!.selected_message()!,
+ message_lists.current.selected_message()!,
);
return true;
}