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.

unread: Fix exception handling mentions in private messages.

Tim Abbottd24e81e1b24a
diff --git a/web/src/unread.js b/web/src/unread.js
index 645a25147e5..42ed4237255 100644
--- a/web/src/unread.js
+++ b/web/src/unread.js
@@ -411,6 +411,10 @@ class UnreadTopicCounter {
for (const message_id of unread_mentions_counter) {
const stream_id = this.bucketer.reverse_lookup.get(message_id);
+ if (stream_id === undefined) {
+ // This is a private message containing a mention.
+ continue;
+ }
streams_with_mentions.add(stream_id);
}
@@ -423,6 +427,11 @@ class UnreadTopicCounter {
// in an unmuted topic within a muted stream.
for (const message_id of unread_mentions_counter) {
const stream_id = this.bucketer.reverse_lookup.get(message_id);
+ if (stream_id === undefined) {
+ // This is a private message containing a mention.
+ continue;
+ }
+
const stream_bucketer = this.bucketer.get_bucket(stream_id);
const topic = stream_bucketer.reverse_lookup.get(message_id);
if (user_topics.is_topic_unmuted(stream_id, topic)) {