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.

typing_events: Handle search_terms() being an empty list.

Aman Agrawalb36163dd8f3d
diff --git a/web/src/typing_events.js b/web/src/typing_events.js
index 2e983fa71af..32dd6343bfd 100644
--- a/web/src/typing_events.js
+++ b/web/src/typing_events.js
@@ -33,7 +33,12 @@ function get_users_typing_for_narrow() {
return [];
}
- const first_term = narrow_state.search_terms()[0];
+ const terms = narrow_state.search_terms();
+ if (terms.length === 0) {
+ return [];
+ }
+
+ const first_term = terms[0];
if (first_term.operator === "dm") {
// Get list of users typing in this conversation
const narrow_emails_string = first_term.operand;