]> cat aescling's git repositories - mastodon.git/commitdiff
Fix 500 errors on searching invalid URLs (#3613)
authorunarist <m.unarist@gmail.com>
Tue, 6 Jun 2017 14:44:48 +0000 (23:44 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 6 Jun 2017 14:44:48 +0000 (16:44 +0200)
app/services/fetch_remote_resource_service.rb
spec/services/fetch_remote_resource_service_spec.rb

index a0c270673ad4c86c7caa8d227c6ef869f78098f1..5dfa3a0ff084f3f3810c9f215b6ef4b6ca660b53 100644 (file)
@@ -5,7 +5,7 @@ class FetchRemoteResourceService < BaseService
 
   def call(url)
     @url = url
-    process_url unless atom_url.nil?
+    process_url unless fetched_atom_feed.nil?
   end
 
   private
index 79834842a3cfbb02b4461ff75f1751226074ca7d..81b0e48e32eb4369e87e3730cd3f36a84d957ed0 100644 (file)
@@ -10,7 +10,7 @@ describe FetchRemoteResourceService do
       url = 'http://example.com/missing-atom'
       service = double
       allow(FetchAtomService).to receive(:new).and_return service
-      allow(service).to receive(:call).with(url).and_return([nil, 'body'])
+      allow(service).to receive(:call).with(url).and_return(nil)
 
       result = subject.call(url)
       expect(result).to be_nil