mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added guards for stripe_plans
setting being null
no-issue There is concern that the settings cache can return `null` for values which it cannot parse correctly, this just ensures that we always have an array where we expect one
This commit is contained in:
parent
8675a7d317
commit
694d92d270
1 changed files with 2 additions and 2 deletions
|
@ -62,7 +62,7 @@ class MembersConfigProvider {
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const plans = this._settingsCache.get('stripe_plans');
|
const plans = this._settingsCache.get('stripe_plans') || [];
|
||||||
|
|
||||||
const priceData = plans.reduce((prices, plan) => {
|
const priceData = plans.reduce((prices, plan) => {
|
||||||
const numberAmount = 0 + plan.amount;
|
const numberAmount = 0 + plan.amount;
|
||||||
|
@ -177,7 +177,7 @@ class MembersConfigProvider {
|
||||||
product: {
|
product: {
|
||||||
name: this._settingsCache.get('stripe_product_name')
|
name: this._settingsCache.get('stripe_product_name')
|
||||||
},
|
},
|
||||||
plans: [COMPLIMENTARY_PLAN].concat(this._settingsCache.get('stripe_plans')),
|
plans: [COMPLIMENTARY_PLAN].concat(this._settingsCache.get('stripe_plans') || []),
|
||||||
appInfo: {
|
appInfo: {
|
||||||
name: 'Ghost',
|
name: 'Ghost',
|
||||||
partner_id: 'pp_partner_DKmRVtTs4j9pwZ',
|
partner_id: 'pp_partner_DKmRVtTs4j9pwZ',
|
||||||
|
|
Loading…
Reference in a new issue