narrow: Fix incorrect method of querying for operands.

Commit 02413f9a1b introduced a bug
where any code reaching `if(operators('search')` would be executed,
which caused inputs where we didn't have the search operator to
throw an error when we do not find a search operan later.

At least one affected cases was narrowing to an empty topic.
This commit is contained in:
Rohitt Vashishtha 2019-06-30 13:36:07 +05:30 committed by Tim Abbott
parent a1cf77ca54
commit d6f5655d0d
1 changed files with 1 additions and 1 deletions

View File

@ -858,7 +858,7 @@ function pick_empty_narrow_banner() {
}
// For empty stream searches within other narrows, we display the stop words
if (current_filter.operators("search")) {
if (current_filter.operands("search").length > 0) {
show_search_query();
return $("#empty_search_narrow_message");
}