Skip to content

Commit

Permalink
Empty bodies no longer throw JSON errors
Browse files Browse the repository at this point in the history
Deleting a phone number returns an empty JSON body, which threw a JSON
parsing error.
  • Loading branch information
Ryan Spore committed Jul 25, 2012
1 parent 8fc5133 commit e0913fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/twilio-ruby/rest/client.rb
Expand Up @@ -218,7 +218,7 @@ def connect_and_send(request) # :doc:
rescue Exception
if retries_left > 0 then retries_left -= 1; retry else raise end
end
object = MultiJson.load response.body if response.body
object = MultiJson.load response.body if response.body.present?
if response.kind_of? Net::HTTPClientError
raise Twilio::REST::RequestError.new object['message'], object['code']
end
Expand Down

0 comments on commit e0913fb

Please sign in to comment.