0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00

Added check for plan nickname to exist

no-issue

When seeding the database with fake members & stripe data, it's possible
to create stripe plans without a nickname. Similarly some other services
do not have a nickname on their plans. This ensures that we do not error
when working with these plans.
This commit is contained in:
Rish 2021-03-10 21:37:43 +05:30 committed by Fabien 'egg' O'Carroll
parent 907ccd9f34
commit cac4ca14ff

View file

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