diff --git a/zephyr/static/js/narrow.js b/zephyr/static/js/narrow.js index 2055f09d7f..2308917da5 100644 --- a/zephyr/static/js/narrow.js +++ b/zephyr/static/js/narrow.js @@ -164,7 +164,7 @@ exports.predicate = function () { exports.operators = function () { if (current_filter === undefined) { - return false; + return []; } return current_filter.operators(); }; @@ -618,7 +618,7 @@ exports.by_stream_subject_uri = function (stream, subject) { exports.narrowed_to_pms = function () { // Are we narrowed to PMs: all PMs or PMs with particular people. var operators = narrow.operators(); - if (!operators) { + if (operators.length === 0) { return false; } if ((operators[0][0] === "pm-with") || diff --git a/zephyr/static/js/subs.js b/zephyr/static/js/subs.js index ee5e8b66ea..be2d69cb81 100644 --- a/zephyr/static/js/subs.js +++ b/zephyr/static/js/subs.js @@ -926,7 +926,7 @@ $(function () { function focus_on_narrowed_stream() { var operators = narrow.operators(); - if (!operators) { + if (operators.length === 0) { return; } var stream_name = operators[0][1];