about summary refs log tree commit diff
path: root/app/services/account_search_service.rb
diff options
context:
space:
mode:
authortrwnh <a@trwnh.com>2019-12-06 12:44:23 -0600
committerEugen Rochko <eugen@zeonfederated.com>2019-12-06 19:44:23 +0100
commit1653ae91ce2fbacd88fc2ad21f15aebb84b71f08 (patch)
tree49b9f312c8b46ad79615c7bfd23f98013444bcb1 /app/services/account_search_service.rb
parent0465d2a3ce52b21d264d64bfa2c3bb299c6a15ca (diff)
Fix account search with no query (#12549)
* Fix account search with no query

Modeled after #12541. Fix #12548

* fix codeclimate
Diffstat (limited to 'app/services/account_search_service.rb')
-rw-r--r--app/services/account_search_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/account_search_service.rb b/app/services/account_search_service.rb
index 7e74cc893..d217dabb3 100644
--- a/app/services/account_search_service.rb
+++ b/app/services/account_search_service.rb
@@ -4,8 +4,8 @@ class AccountSearchService < BaseService
   attr_reader :query, :limit, :offset, :options, :account
 
   def call(query, account = nil, options = {})
-    @acct_hint = query.start_with?('@')
-    @query     = query.strip.gsub(/\A@/, '')
+    @acct_hint = query&.start_with?('@')
+    @query     = query&.strip&.gsub(/\A@/, '')
     @limit     = options[:limit].to_i
     @offset    = options[:offset].to_i
     @options   = options