mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 17:17:32 +00:00
Fix 500 errors on searching invalid URLs (#3613)
This commit is contained in:
parent
004672aa6c
commit
e34c5a3503
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue