about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-20 18:36:12 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-20 18:36:12 +0200
commit852c82435d8e86fdd98ceb749eeb8578020fae18 (patch)
tree8e2f624f04ea6be44c0102be3132af94847dbdc3
parent04bbc576906ff70feed7d42fef0e6db17fdd9ed3 (diff)
Fix method return when rescuing
-rw-r--r--app/services/fetch_remote_account_service.rb2
-rw-r--r--app/services/fetch_remote_status_service.rb1
2 files changed, 3 insertions, 0 deletions
diff --git a/app/services/fetch_remote_account_service.rb b/app/services/fetch_remote_account_service.rb
index 8a6b1e1b4..7977f5cba 100644
--- a/app/services/fetch_remote_account_service.rb
+++ b/app/services/fetch_remote_account_service.rb
@@ -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
diff --git a/app/services/fetch_remote_status_service.rb b/app/services/fetch_remote_status_service.rb
index ae0d7e8a5..fbf7e3bd6 100644
--- a/app/services/fetch_remote_status_service.rb
+++ b/app/services/fetch_remote_status_service.rb
@@ -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