From 97452ea4f89cc04121c81a61ce1faa79f9a426ad Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Thu, 9 Oct 2025 16:25:04 +0530 Subject: [PATCH] hotkey: Fix wrong assumption of message_lists.current is defined. Since we are checking `is_in_focus()` of recent and inbox view, message_lists.current can be not defined here, also addition a new view in Zulip will make this fail. --- web/src/hotkey.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/hotkey.ts b/web/src/hotkey.ts index 328b3d9391..1f03cc0927 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; }