From 48cb8d14da41f93a26e48ba04237c88dcedaa786 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Wed, 2 Oct 2019 10:36:13 +0700 Subject: [PATCH] Wrapped getCustomer in try catch no-issue This protects against live/test mode poisoned databases --- ghost/members-api/lib/stripe/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ghost/members-api/lib/stripe/index.js b/ghost/members-api/lib/stripe/index.js index 1cf8847e74..4cf7a1bf21 100644 --- a/ghost/members-api/lib/stripe/index.js +++ b/ghost/members-api/lib/stripe/index.js @@ -141,9 +141,13 @@ module.exports = class StripePaymentProcessor { const metadata = await this.storage.get(member); for (const data in metadata) { - const customer = await this.getCustomer(data.customer_id); - if (!customer.deleted) { - return customer; + try { + const customer = await this.getCustomer(data.customer_id); + if (!customer.deleted) { + return customer; + } + } catch (e) { + console.log(e); } }