Skip to content

Commit 2c3ebc5

Browse files
authored
fix(site): handle null warnings in health page (#10775)
1 parent d19a762 commit 2c3ebc5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

site/src/pages/HealthPage/HealthPage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ export function HealthPageView({
103103
{healthStatus.healthy
104104
? Object.keys(sections).some(
105105
(key) =>
106-
healthStatus[key as keyof typeof sections]?.warnings
106+
healthStatus[key as keyof typeof sections].warnings !==
107+
null &&
108+
healthStatus[key as keyof typeof sections].warnings
107109
.length > 0,
108110
)
109111
? "All systems operational, but performance might be degraded"
@@ -163,7 +165,7 @@ export function HealthPageView({
163165
const healthSection =
164166
healthStatus[key as keyof typeof sections];
165167
const isHealthy = healthSection.healthy;
166-
const isWarning = healthSection.warnings.length > 0;
168+
const isWarning = healthSection.warnings?.length > 0;
167169
return (
168170
<Box
169171
component="button"

0 commit comments

Comments
 (0)