From d4407b9acd8f67f61eaeb5e9861751fb79f3ee2a Mon Sep 17 00:00:00 2001 From: Rishabh Date: Wed, 16 Mar 2022 21:08:47 +0530 Subject: [PATCH] Fixed empty subscription object for comped members refs https://github.com/TryGhost/Team/issues/1428 Editing a comped member's name doesn't return the dummy subscription object in API response, causing unexpected crash in Portal when setting Plan label as it expect's a subscription for a paid member. This change gracefully handles the crash and instead shows empty information for plan label so member can continue using Portal as expected. --- ghost/portal/src/components/pages/AccountHomePage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/portal/src/components/pages/AccountHomePage.js b/ghost/portal/src/components/pages/AccountHomePage.js index a1bcf9b1a0..480ee844d8 100644 --- a/ghost/portal/src/components/pages/AccountHomePage.js +++ b/ghost/portal/src/components/pages/AccountHomePage.js @@ -197,7 +197,7 @@ const PaidAccountActions = () => { const { offer, start_date: startDate - } = subscription; + } = subscription || {}; let label = ''; if (price) { const {amount = 0, currency, interval} = price;