From 74bfa62d78a6064165b528fbdabfe8af4b3a67cc Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 30 May 2024 10:07:59 -0700 Subject: [PATCH] left_sidebar_navigation_area: Fix TypeScript noUncheckedIndexedAccess errors. Signed-off-by: Anders Kaseorg --- web/src/left_sidebar_navigation_area.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/left_sidebar_navigation_area.ts b/web/src/left_sidebar_navigation_area.ts index 1c6d686a02..4863fb80bf 100644 --- a/web/src/left_sidebar_navigation_area.ts +++ b/web/src/left_sidebar_navigation_area.ts @@ -97,14 +97,14 @@ export function handle_narrow_activated(filter: Filter): void { // TODO: handle confused filters like "in:all stream:foo" ops = filter.operands("in"); - if (ops.length >= 1) { + if (ops[0] !== undefined) { filter_name = ops[0]; if (filter_name === "home") { highlight_all_messages_view(); } } ops = filter.operands("is"); - if (ops.length >= 1) { + if (ops[0] !== undefined) { filter_name = ops[0]; if (filter_name === "starred") { $filter_li = $(".top_left_starred_messages");