🐛Add null check to sub_sponsor endpoint
Causes exception when sponsor has deleted their account.
This commit is contained in:
parent
bc928253a5
commit
a208a514d2
1 changed files with 1 additions and 1 deletions
|
@ -401,7 +401,7 @@ UserHandler = class UserHandler extends Handler
|
|||
name: sponsor.get('name')
|
||||
|
||||
# Get recipient subscription info
|
||||
findStripeSubscription sponsor.get('stripe').customerID, userID: req.user.id, (subscription) =>
|
||||
findStripeSubscription sponsor.get('stripe')?.customerID, userID: req.user.id, (subscription) =>
|
||||
info.subscription = subscription
|
||||
@sendDatabaseError(res, 'No sponsored subscription found') unless info.subscription?
|
||||
@sendSuccess(res, info)
|
||||
|
|
Reference in a new issue