Skip to content

Commit

Permalink
Merge pull request #1536 from pelias/handle-empty-admin-tokens
Browse files Browse the repository at this point in the history
Ignore empty tokens in query view
  • Loading branch information
orangejulius authored Jun 23, 2021
2 parents 33ab9d0 + 210b00c commit 956e9fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion query/view/admin_multi_match_first.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function (adminFields) {
// the actual query text is simply taken from the first valid admin field
// this assumes all the values would be the same, which is probably not true
// TODO: handle the case where not all admin area input values are the same
var tokens = vs.var('input:' + valid_admin_properties[0]).get().split(/\s+/g);
var tokens = vs.var('input:' + valid_admin_properties[0]).get().split(/\s+/g).filter(t => t.length > 0);

// no valid tokens to use, fail now, don't render this view.
if (!tokens || tokens.length < 2) { return null; }
Expand Down

0 comments on commit 956e9fc

Please sign in to comment.