Avoid type errors for bad PM narrows.

If somebody narrows to pm-with:bad_email@example.com, we no longer
generate a type error by trying to call addClass on undefined.
This commit is contained in:
Steve Howell 2017-06-15 15:52:42 -04:00
parent 1d0b7e07cc
commit fe9020972a
1 changed files with 4 additions and 1 deletions

View File

@ -143,7 +143,10 @@ exports.rebuild_recent = function (active_conversation) {
private_li.append(private_messages_dom);
}
if (active_conversation) {
exports.get_conversation_li(active_conversation).addClass('active-sub-filter');
var active_li = exports.get_conversation_li(active_conversation);
if (active_li) {
active_li.addClass('active-sub-filter');
}
}
resize.resize_stream_filters_container();