Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
topic_generator: Handle `curr_topic` being empty string.
Aman Agrawal930f85722e50
diff --git a/web/src/topic_generator.ts b/web/src/topic_generator.tsindex 3ed2bc75518..3f3af3ddd6c 100644--- a/web/src/topic_generator.ts+++ b/web/src/topic_generator.ts@@ -26,7 +26,7 @@ export function next_topic(if (curr_stream_index >= 0) {const {channel_id} = sorted_channels_info[curr_stream_index]!;const topics = get_topics(channel_id);- const curr_topic_index = curr_topic ? topics.indexOf(curr_topic) : -1; // -1 if not found+ const curr_topic_index = curr_topic !== undefined ? topics.indexOf(curr_topic) : -1; // -1 if not foundfor (let i = curr_topic_index + 1; i < topics.length; i += 1) {const topic = topics[i]!;