diff --git a/script/index.coffee b/script/index.coffee index 6a64fc2c99..c975b086fb 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -1270,8 +1270,8 @@ api.wrap = (user, main=true) -> # If user cancelled subscription, we give them until 30day's end until it terminates - plan = user.purchased.plan - if plan.customerId && plan.dateTerminated && moment(plan.dateTerminated).isBefore(+new Date) + plan = user.purchased?.plan + if plan && plan.customerId && plan.dateTerminated && moment(plan.dateTerminated).isBefore(+new Date) _.merge user.purchased.plan, {planId:null, customerId:null, paymentMethod:null} user.markModified 'purchased.plan'