Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add nil check for parsed_body #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 13, 2017

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