From c72c8a948f498218d06ffd651debf3e0c16f969a Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sun, 11 May 2014 15:35:35 -0600 Subject: [PATCH] fix(cron): plan check so it passes tests --- script/index.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'