Fix account search with no query (#12549)

* Fix account search with no query

Modeled after #12541. Fix #12548

* fix codeclimate
pull/12563/head
trwnh 2019-12-06 12:44:23 -06:00 committed by Eugen Rochko
parent 0465d2a3ce
commit 1653ae91ce
1 changed files with 2 additions and 2 deletions

View File

@ -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