From 79eddcc73625931dbcce626f871be85088735cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Fern=C3=A1ndez=20Capel?= Date: Fri, 5 Jan 2018 15:01:53 +0000 Subject: [PATCH] Fix subscription page for members of a group For a member of a group LimitationsManager.userHasSubscriptionOrIsGroupMember doesn't return any subscription, so when the controller tries to access subscription.recurlySubscription_id there's an error. SubscriptionViewModelBuilder already knows how to handle the case in which the user is a member of a group but has not subscription of their own, so guarding against the crash is enough to fix the issue. --- .../coffee/Features/Subscription/SubscriptionController.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee b/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee index e665aa517d..81e2dcab63 100644 --- a/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee +++ b/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee @@ -97,7 +97,7 @@ module.exports = SubscriptionController = logger.log user: user, "redirecting to plans" res.redirect "/user/subscription/plans" else - RecurlyWrapper.getSubscription subscription.recurlySubscription_id, + RecurlyWrapper.getSubscription subscription?.recurlySubscription_id, includeAccount: true, (err, usersSubscription)-> # always render the page, but skip the recurly link if