0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Wrapped getCustomer in try catch

no-issue

This protects against live/test mode poisoned databases
This commit is contained in:
Fabien O'Carroll 2019-10-02 10:36:13 +07:00
parent d1b29fd0b7
commit 48cb8d14da

View file

@ -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);
}
}