mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 17:36:27 +00:00
typing: Fix assertion error when narrowed to a non existing stream.
When narrowing to a stream which doesn't exist, the code to render users who are typing in that narrow resulted in an assertion error as the stream didn't exist. This commit removes the assertion and returns an empty array (array of users who are typing) in such case to fix the issue.
This commit is contained in:
committed by
Tim Abbott
parent
f023a11d01
commit
a8d056ac3b
@@ -50,7 +50,10 @@ function get_users_typing_for_narrow(): number[] {
|
||||
if (narrow_state.narrowed_by_topic_reply()) {
|
||||
const current_stream_id = narrow_state.stream_id();
|
||||
const current_topic = narrow_state.topic();
|
||||
assert(current_stream_id !== undefined);
|
||||
if (current_stream_id === undefined) {
|
||||
// narrowed to a stream which doesn't exist.
|
||||
return [];
|
||||
}
|
||||
assert(current_topic !== undefined);
|
||||
return typing_data.get_topic_typists(current_stream_id, current_topic);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user