Don't try to test message visibility when it's not in the current stream.

Fixes the JS traceback "'null' is not an object" introduced in b67e52d.

Testing: Receive a message when narrowed to a different subject, with
the window focused.

(imported from commit 54b9e7924a2bf66ba5cc9799fc3687a084496465)
This commit is contained in:
Kevin Mehall 2013-07-05 11:03:14 -04:00
parent 49e3ba7cb3
commit 97b7b6ee33
1 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,8 @@ exports.message_is_visible = function (vp, message) {
var height = vp.visible_height;
var row = rows.get(message.id, current_msg_list.table_name);
if (row.length === 0) return false;
var row_offset = row.offset();
var row_height = row.height();
// Very tall messages are visible once we've gotten past them