mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Added guard for missing portal plans in portal site data
refs https://github.com/TryGhost/Team/issues/2276 Portal died with an unintelligible error about portal plans/includes being undefined when there was another react error on the page. The other error somehow caused the `site` data to be empty object for Portal, and there was one place where we didn't check for the empty object while transforming the site data which caused the failure. This change adds the guard for failing check so we don't throw the error in such cases and process as normal.
This commit is contained in:
parent
dd256f3517
commit
2487a314f5
@ -288,7 +288,7 @@ export function transformApiSiteData({site}) {
|
||||
}
|
||||
|
||||
// self signup must be available for free plan signup to work
|
||||
if (site.portal_plans.includes('free')) {
|
||||
if (site.portal_plans?.includes('free')) {
|
||||
site.allow_self_signup = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user