Skip to content

Fixes the case where previous_attributes is null#291

Merged
olivierbellone merged 2 commits intomasterfrom
ob-fix-290
May 12, 2016
Merged

Fixes the case where previous_attributes is null#291
olivierbellone merged 2 commits intomasterfrom
ob-fix-290

Conversation

@olivierbellone
Copy link
Copy Markdown
Contributor

Fixes #290.

In practice, an event's previous_attributes should never be set to null -- it should either be entirely absent from the JSON payload, or have a non-null value if present.

However, some of the dummy events sent by the "Send test webhook" button do have previous_attributes=null. Ideally, we should also fix this, but this PR does make the event deserializer a little more robust.

r? @kyleconroy
cc @stripe/api-libraries

@brandur
Copy link
Copy Markdown
Contributor

brandur commented May 11, 2016

Thanks for digging into this Olivier! :)

@kyleconroy
Copy link
Copy Markdown
Contributor

A simple test case would be nice, but not required. LGTM

@olivierbellone
Copy link
Copy Markdown
Contributor Author

@kyleconroy Added a test as you suggested.

@kyleconroy
Copy link
Copy Markdown
Contributor

👍

@olivierbellone olivierbellone merged commit 35d60fa into master May 12, 2016
@olivierbellone olivierbellone deleted the ob-fix-290 branch May 12, 2016 17:45
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.

"Not a JSON Object: null" when parsing customer.source.updated event

4 participants