Fix a "can't read property 'id' of undefined" user error

`current_msg_list.get(id)` and `rows.get(id,
current_msg_list.table_name)` are not interchangable in terms of
checking for whether we have a message.  The former checks whether
the message is in the current message list while the latter checks
whether the message is in the current message list and currently
rendered.  `message_edit.end` only operates on rendered messages.

(imported from commit 203ee612bfd0aa94571dde9b601e948b3c6f6cbb)
This commit is contained in:
Zev Benjamin 2013-06-04 15:39:51 -04:00
parent 6bd61f458d
commit d95ea89f54
1 changed files with 3 additions and 2 deletions

View File

@ -746,8 +746,9 @@ function update_messages(events) {
process_message_for_recent_subjects(msg);
}
if (current_msg_list.get(event.message_id)) {
message_edit.end(rows.get(event.message_id, current_msg_list.table_name));
var row = rows.get(event.message_id, current_msg_list.table_name);
if (row.length > 0) {
message_edit.end(row);
}
msg.last_edit_timestamp = event.edit_timestamp;