Skip to content

Instantly share code, notes, and snippets.

@leothekim
Created July 27, 2015 22:26
Show Gist options
  • Select an option

  • Save leothekim/0e52f0a7e71ba9150e3d to your computer and use it in GitHub Desktop.

Select an option

Save leothekim/0e52f0a7e71ba9150e3d to your computer and use it in GitHub Desktop.
diff --git a/src/main/java/com/stripe/model/EventDataDeserializer.java b/src/main/java/com/stripe/model/EventDataDeserializer.java
index 9489b98..f4106f4 100644
--- a/src/main/java/com/stripe/model/EventDataDeserializer.java
+++ b/src/main/java/com/stripe/model/EventDataDeserializer.java
@@ -99,7 +99,9 @@ public class EventDataDeserializer implements JsonDeserializer<EventData> {
JsonElement element = entry.getValue();
if("previous_attributes".equals(key)) {
Map<String, Object> previousAttributes = new HashMap<String, Object>();
- populateMapFromJSONObject(previousAttributes, element.getAsJsonObject());
+ if (element.getAsJsonObject() != null) {
+ populateMapFromJSONObject(previousAttributes, element.getAsJsonObject());
+ }
eventData.setPreviousAttributes(previousAttributes);
} else if ("object".equals(key)) {
String type = element.getAsJsonObject().get("object").getAsString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment