add_to_table: bail early if there are no messages to render

This bug affected receiving messages while narrowed.  When none of
the messages recieved matched the narrow predicate, we'd try to
render messages and then create a jQuery object out of a bunch of
newlines (the only thing that results from a render of 0 messages).

(imported from commit 81f5aa46fac06fe0e5a14a8757f245f90b5845cc)
This commit is contained in:
Zev Benjamin
2012-11-20 14:06:36 -05:00
parent 57fbf21a7a
commit dbb0241568

View File

@@ -335,6 +335,10 @@ function add_to_table(messages, table_name, filter_function, where, allow_collap
prev = message;
});
if (messages_to_render.length === 0) {
return;
}
if (current_group.length > 0)
new_message_groups.push(current_group);