Browse Source

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
pull/4/head
Renato "Lond" Cerqueira 6 years ago
committed by Eugen Rochko
parent
commit
fe180f18ff
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/services/fetch_remote_status_service.rb

+ 1
- 1
app/services/fetch_remote_status_service.rb View File

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

Loading…
Cancel
Save