nylas / nylas-ruby

Ruby bindings for the Nylas Platform APIs
https://nylas.com/docs
MIT License
101 stars 130 forks source link

Fix `NoMethodError` when calling `NewMessage#send!` #359

Closed mrashed-dev closed 2 years ago

mrashed-dev commented 2 years ago

Description

This PR adds an extra check when sending a NewMessage object by checking if the API response is a Hash before attempting to create a Message option out of it, preventing the chance of a NoMethodError. This PR closes issue #358.

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.