Protected against null value for subscription.plan

no-issue

This will only occur when Subscriptions have manually been modified in
Stripe to no longer have a single price.
This commit is contained in:
Fabien "egg" O'Carroll 2022-02-09 11:28:26 +02:00
parent f0a3ddaf09
commit d7d7806dcf

View File

@ -80,7 +80,7 @@ module.exports = class MemberRepository {
}
isComplimentarySubscription(subscription) {
return subscription.plan.nickname && subscription.plan.nickname.toLowerCase() === 'complimentary';
return subscription.plan && subscription.plan.nickname && subscription.plan.nickname.toLowerCase() === 'complimentary';
}
async get(data, options) {