1
0
Fork 0
forked from fedi/mastodon

Fix method return when rescuing

This commit is contained in:
Eugen Rochko 2016-10-20 18:36:12 +02:00
parent 04bbc57690
commit 852c82435d
2 changed files with 3 additions and 0 deletions

View file

@ -21,7 +21,9 @@ class FetchRemoteAccountService < BaseService
return FollowRemoteAccountService.new.call("#{username}@#{domain}")
rescue TypeError => e
Rails.logger.debug "Unparseable URL given: #{url}"
nil
rescue Nokogiri::XML::XPath::SyntaxError
Rails.logger.debug "Invalid XML or missing namespace"
nil
end
end

View file

@ -33,5 +33,6 @@ class FetchRemoteStatusService < BaseService
return FollowRemoteAccountService.new.call("#{username}@#{domain}")
rescue Nokogiri::XML::XPath::SyntaxError
Rails.logger.debug "Invalid XML or missing namespace"
nil
end
end