From d3197182812aa8ba13592184ba68f8ec7b83f88d Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Mon, 8 Apr 2024 16:01:41 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20Gscan=20type=20error=20c?= =?UTF-8?q?rashing=20settings=20(#19994)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../components/settings/site/theme/ThemeInstalledModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/admin-x-settings/src/components/settings/site/theme/ThemeInstalledModal.tsx b/apps/admin-x-settings/src/components/settings/site/theme/ThemeInstalledModal.tsx index 1c3c4aa97a..53bad6185d 100644 --- a/apps/admin-x-settings/src/components/settings/site/theme/ThemeInstalledModal.tsx +++ b/apps/admin-x-settings/src/components/settings/site/theme/ThemeInstalledModal.tsx @@ -45,7 +45,7 @@ const ThemeInstalledModal: React.FC<{ const handleError = useHandleError(); let errorPrompt = null; - if (installedTheme.gscan_errors) { + if (installedTheme && installedTheme.gscan_errors) { errorPrompt =
Highly recommended to fix, functionality could be restricted} title="Errors"> {installedTheme.gscan_errors?.map(error => )} @@ -54,7 +54,7 @@ const ThemeInstalledModal: React.FC<{ } let warningPrompt = null; - if (installedTheme.warnings) { + if (installedTheme && installedTheme.warnings) { warningPrompt =
{installedTheme.warnings?.map(warning => )}