Skip to content

Commit

Permalink
Fix 500 errors on searching invalid URLs (mastodon#3613)
Browse files Browse the repository at this point in the history
  • Loading branch information
unarist authored and koteitan committed Jun 25, 2017
1 parent 65eac01 commit 7154bba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/services/fetch_remote_resource_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/services/fetch_remote_resource_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
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
Expand Down

0 comments on commit 7154bba

Please sign in to comment.