diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-12-30 18:30:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-30 18:30:24 +0100 |
commit | bb27ca14ef5e2b0b3108c476a62a0e6d559e070a (patch) | |
tree | f3fec5668ab86e5e5323f7484cb4efbb1619b459 /app/lib | |
parent | 108e390d231159a6dc3509f8aece1c325296e0c3 (diff) |
Fix error when searching for empty phrase (#12711)
Fix #12619
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/search_query_transformer.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/search_query_transformer.rb b/app/lib/search_query_transformer.rb index 6a299f59d..e07ebfffe 100644 --- a/app/lib/search_query_transformer.rb +++ b/app/lib/search_query_transformer.rb @@ -78,7 +78,7 @@ class SearchQueryTransformer < Parslet::Transform elsif clause[:shortcode] TermClause.new(prefix, operator, ":#{clause[:term]}:") elsif clause[:phrase] - PhraseClause.new(prefix, operator, clause[:phrase].map { |p| p[:term].to_s }.join(' ')) + PhraseClause.new(prefix, operator, clause[:phrase].is_a?(Array) ? clause[:phrase].map { |p| p[:term].to_s }.join(' ') : clause[:phrase].to_s) else raise "Unexpected clause type: #{clause}" end |