From de33b787b915b6c536c831f71b92aadf632a6231 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 17 Nov 2023 22:04:41 +0000 Subject: [PATCH] fix(site): handle null warnings in health page --- site/src/pages/HealthPage/HealthPage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/site/src/pages/HealthPage/HealthPage.tsx b/site/src/pages/HealthPage/HealthPage.tsx index 14018b3e8a752..cd1c94b9c0294 100644 --- a/site/src/pages/HealthPage/HealthPage.tsx +++ b/site/src/pages/HealthPage/HealthPage.tsx @@ -103,7 +103,9 @@ export function HealthPageView({ {healthStatus.healthy ? Object.keys(sections).some( (key) => - healthStatus[key as keyof typeof sections]?.warnings + healthStatus[key as keyof typeof sections].warnings !== + null && + healthStatus[key as keyof typeof sections].warnings .length > 0, ) ? "All systems operational, but performance might be degraded" @@ -163,7 +165,7 @@ export function HealthPageView({ const healthSection = healthStatus[key as keyof typeof sections]; const isHealthy = healthSection.healthy; - const isWarning = healthSection.warnings.length > 0; + const isWarning = healthSection.warnings?.length > 0; return (