Don't throw an exception if someone edits a very old message

Previously, if you didn't have a message that someone else had edited
in your message list, you would get an exception because we weren't
checking whether we actually had the message or not.

(imported from commit 33a5c6e7fe95b5397a32df5c7b5f6714d71e1e5f)
This commit is contained in:
Zev Benjamin
2013-06-04 15:38:42 -04:00
parent 23b4ad3b02
commit 6bd61f458d

View File

@@ -719,6 +719,10 @@ function maybe_add_narrowed_messages(messages, msg_list) {
function update_messages(events) {
$.each(events, function (idx, event) {
var msg = all_msg_list.get(event.message_id);
if (msg === undefined) {
return;
}
if (event.rendered_content !== undefined) {
msg.content = event.rendered_content;
}