Fix JS error syncing starred out-of-view messages.

Previously, if one starred very old messages (or ones in a stream
you're not subscribed to), your other open browsers would likely throw
an exception syncing the message flag.
This commit is contained in:
Tim Abbott
2017-01-22 20:38:57 -08:00
parent c082564c66
commit a3b51bb9d2

View File

@@ -210,6 +210,11 @@ exports.update_starred = function (message_id, starred) {
// lists.
var message = exports.find_message(message_id);
// If it isn't cached in the browser, no need to do anything
if (message === undefined) {
return;
}
unread.mark_message_as_read(message);
message.starred = starred;