]> cat aescling's git repositories - mastodon.git/commit
Fix undefined method error in sidekiq (#9807)
authorRenato "Lond" Cerqueira <renato@lond.com.br>
Mon, 14 Jan 2019 16:28:41 +0000 (17:28 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 14 Jan 2019 16:28:41 +0000 (17:28 +0100)
commit5c5e14c816eb0871344bb69a96bc4bb38e0d3061
treeccb3b71f7c2c570530938f61ee375f7414b36592
parentb4e6384aeafc9011707aa27d4948aaa9ca907db3
Fix undefined method error in sidekiq (#9807)

* Fix undefined method error in sidekiq

Body can be not nil but still be empty, which causes a
`NoMethodError: undefined method `[]' for nil:NilClass` further in the
code. This checks for an empty body to avoid the issue.

* Fix codeclimate issue
app/services/fetch_oembed_service.rb
spec/fixtures/requests/oembed_json_empty.html [new file with mode: 0644]
spec/services/fetch_oembed_service_spec.rb