From 1653ae91ce2fbacd88fc2ad21f15aebb84b71f08 Mon Sep 17 00:00:00 2001 From: trwnh Date: Fri, 6 Dec 2019 12:44:23 -0600 Subject: [PATCH] Fix account search with no query (#12549) * Fix account search with no query Modeled after #12541. Fix #12548 * fix codeclimate --- app/services/account_search_service.rb | 4 ++-- 1 file 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