From 757f06136217192e088af347816c2f09e22457fe Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 24 May 2021 21:17:40 +0530 Subject: [PATCH] Added stripe connect guard for saving product no refs While saving on membership screen, we also try and save the product with any prices that have changed. In case Stripe is not connected, saving Product doesn't make sense as we should not edit prices for the default product without Stripe connection. --- ghost/admin/app/controllers/settings/membership.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/controllers/settings/membership.js b/ghost/admin/app/controllers/settings/membership.js index 806b9d479a..1645d7556e 100644 --- a/ghost/admin/app/controllers/settings/membership.js +++ b/ghost/admin/app/controllers/settings/membership.js @@ -271,7 +271,8 @@ export default class MembersAccessController extends Controller { } async saveProduct() { - if (this.product) { + const isStripeConnected = this.settings.get('stripeConnectAccountId'); + if (this.product && isStripeConnected) { const stripePrices = this.product.stripePrices || []; const monthlyAmount = this.stripeMonthlyAmount * 100; const yearlyAmount = this.stripeYearlyAmount * 100;