Fixed an error with missing identity details in patreon request

This commit is contained in:
Stefan Zermatten
2020-11-05 12:59:26 +02:00
parent 9722bbc667
commit 88df942c59

View File

@@ -61,7 +61,7 @@ const updateIdentity = Meteor.wrapAsync(function(accessToken, userId, callback){
}
try {
let identity = JSON.parse(body);
let membership = identity.included[0];
let membership = identity.included && identity.included[0];
let entitledAmount = membership && membership.attributes
.currently_entitled_amount_cents || 0;
writeEntitledCents(userId, entitledAmount);