summaryrefslogtreecommitdiffstats
path: root/app/services/fetch_remote_status_service.rb
diff options
context:
space:
mode:
authorRenato "Lond" Cerqueira <renato@lond.com.br>2017-12-12 15:11:13 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-12-12 15:11:13 +0100
commitfe180f18ff38a01007842ccff293a84a63336aae (patch)
treeedd1311bf1cc3a0a6ca13c7c092cbda5d1668d63 /app/services/fetch_remote_status_service.rb
parent1486fd64cc73d1efb713ad3801cb8ae7acc0de1f (diff)
Change conditional to avoid nil into string error in sidekiq (#5987)
* Change conditional to avoid nil into string error in sidekiq When obtaining information about users with mastodon in a different subdomain, sidekiq was giving out a 'no implicit conversion of nil into String' * Use presence instead of blank? with ternary. Following suggestion on PR
Diffstat (limited to 'app/services/fetch_remote_status_service.rb')
-rw-r--r--app/services/fetch_remote_status_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/fetch_remote_status_service.rb b/app/services/fetch_remote_status_service.rb
index 9c009335b6e..9c3008035d5 100644
--- a/app/services/fetch_remote_status_service.rb
+++ b/app/services/fetch_remote_status_service.rb
@@ -40,6 +40,6 @@ class FetchRemoteStatusService < BaseService
end
def confirmed_domain?(domain, account)
- account.domain.nil? || domain.casecmp(account.domain).zero? || domain.casecmp(Addressable::URI.parse(account.remote_url || account.uri).normalized_host).zero?
+ account.domain.nil? || domain.casecmp(account.domain).zero? || domain.casecmp(Addressable::URI.parse(account.remote_url.presence || account.uri).normalized_host).zero?
end
end