Fixed creating members without products

refs https://github.com/TryGhost/Team/issues/790

We were missing a check for the existence of memberData.products before
attempting to read the length property from it, which can result in an
Uncaught TypeError
This commit is contained in:
Fabien O'Carroll 2021-07-06 11:52:08 +01:00
parent 7545e67f2c
commit 12a3ae77cf

View File

@ -88,7 +88,7 @@ module.exports = class MemberRepository {
status: 'free' status: 'free'
}; };
if (memberData.products.length === 1) { if (memberData.products && memberData.products.length === 1) {
memberStatusData.status = 'comped'; memberStatusData.status = 'comped';
} }