add null check and default empty object for subscirption dashboard

This commit is contained in:
Henry Oswald
2016-02-03 17:41:05 +00:00
parent 8af9aa6396
commit 47eebb1840
2 changed files with 2 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ module.exports = SubscriptionController =
recomendedCurrency: subscription?.currency
taxRate:subscription?.taxRate
plans: plans
subscription: subscription
subscription: subscription || {}
groups: groups
subscriptionTabActive: true

View File

@@ -76,7 +76,7 @@ define [
App.controller "UserSubscriptionController", ($scope, MultiCurrencyPricing, $http, sixpack) ->
freeTrialEndDate = new Date(subscription.trial_ends_at)
freeTrialEndDate = new Date(subscription?.trial_ends_at)
sevenDaysTime = new Date()
sevenDaysTime.setDate(sevenDaysTime.getDate() + 7)