Skip to content

Comments

add nil check for parsed_body#353

Merged
choran merged 1 commit intointercom:masterfrom
ipc103:bugfix-no-method-error-parse-body
Oct 13, 2017
Merged

add nil check for parsed_body#353
choran merged 1 commit intointercom:masterfrom
ipc103:bugfix-no-method-error-parse-body

Conversation

@ipc103
Copy link
Contributor

@ipc103 ipc103 commented Sep 28, 2017

Closes #339

Sometimes, parsing the decoded body will result in a nil value (i.e. if the decoded_body is "null". Here, we only call [] if the parsed_body is something that can respond to it.

Rather than raising a NoMethodError, the parse_body method will return nil if the decoded_body parses to nil.

Copy link
Member

@choran choran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍
Tested it locally and all tests pass
Thanks for submitting this

@choran choran merged commit 042fb37 into intercom:master Oct 13, 2017
@ipc103
Copy link
Contributor Author

ipc103 commented Oct 13, 2017

Awesome - glad I could help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants