diff --git a/apps/admin-x-settings/src/components/settings/site/theme/InvalidThemeModal.tsx b/apps/admin-x-settings/src/components/settings/site/theme/InvalidThemeModal.tsx index 8a7b7d7ba9..e827414145 100644 --- a/apps/admin-x-settings/src/components/settings/site/theme/InvalidThemeModal.tsx +++ b/apps/admin-x-settings/src/components/settings/site/theme/InvalidThemeModal.tsx @@ -6,7 +6,7 @@ import {ThemeProblem} from '@tryghost/admin-x-framework/api/themes'; type FatalError = { details: { errors: ThemeProblem[]; - }; + }|string; }; export type FatalErrors = FatalError[]; @@ -63,7 +63,15 @@ const InvalidThemeModal: React.FC<{ if (fatalErrors) { warningPrompt =
- {fatalErrors?.map(error => error?.details?.errors?.map(err => ))} + {fatalErrors.map((error) => { + if (typeof error.details === 'object' && error.details.errors && error.details.errors.length > 0) { + return error.details.errors.map(err => ); + } else if (typeof error.details === 'string') { + return ; + } else { + return null; + } + })}
; }