mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 00:52:36 +03:00
🐛 Fixed Gscan type error crashing settings (#19994)
ref ENG-189 - A type error was flagged by Sentry where Settingscrashed where the API data wasn't formatted correctly and the error boundary didn't kick in. - This adds additional safety to ensure the required data exists before attempting to render the elements.
This commit is contained in:
parent
58e5aa5b53
commit
d319718281
@ -45,7 +45,7 @@ const ThemeInstalledModal: React.FC<{
|
|||||||
const handleError = useHandleError();
|
const handleError = useHandleError();
|
||||||
|
|
||||||
let errorPrompt = null;
|
let errorPrompt = null;
|
||||||
if (installedTheme.gscan_errors) {
|
if (installedTheme && installedTheme.gscan_errors) {
|
||||||
errorPrompt = <div className="mt-6">
|
errorPrompt = <div className="mt-6">
|
||||||
<List hint={<>Highly recommended to fix, functionality <strong>could</strong> be restricted</>} title="Errors">
|
<List hint={<>Highly recommended to fix, functionality <strong>could</strong> be restricted</>} title="Errors">
|
||||||
{installedTheme.gscan_errors?.map(error => <ThemeProblemView problem={error} />)}
|
{installedTheme.gscan_errors?.map(error => <ThemeProblemView problem={error} />)}
|
||||||
@ -54,7 +54,7 @@ const ThemeInstalledModal: React.FC<{
|
|||||||
}
|
}
|
||||||
|
|
||||||
let warningPrompt = null;
|
let warningPrompt = null;
|
||||||
if (installedTheme.warnings) {
|
if (installedTheme && installedTheme.warnings) {
|
||||||
warningPrompt = <div className="mt-10">
|
warningPrompt = <div className="mt-10">
|
||||||
<List title="Warnings">
|
<List title="Warnings">
|
||||||
{installedTheme.warnings?.map(warning => <ThemeProblemView problem={warning} />)}
|
{installedTheme.warnings?.map(warning => <ThemeProblemView problem={warning} />)}
|
||||||
|
Loading…
Reference in New Issue
Block a user