Skip to content

Commit 6885085

Browse files
ahussein3Ahmed Magdyfoot
authored
Fix UI break if there is no Key message in cluster condtitions (#1160)
Co-authored-by: Ahmed Magdy <[email protected]> Co-authored-by: Simon <[email protected]>
1 parent 8e6403c commit 6885085

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ui-cra/src/components/Clusters/ClusterDashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const ClusterDashboard = ({ clusterName }: Props) => {
8686
<RouterTab name="Details" path={`${path}/details`}>
8787
<ClusterDashbordWrapper>
8888
{currentCluster?.conditions &&
89-
currentCluster?.conditions[0].message ? (
89+
currentCluster?.conditions[0]?.message ? (
9090
<div style={{ paddingBottom: theme.spacing.small }}>
9191
<KubeStatusIndicator
9292
conditions={currentCluster.conditions}

ui-cra/src/components/Clusters/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ const MCCP: FC = () => {
434434
{
435435
label: 'Message',
436436
value: (c: GitopsClusterEnriched) =>
437-
(c.conditions && c.conditions[0].message) || null,
437+
(c.conditions && c.conditions[0]?.message) || null,
438438
sortType: SortType.string,
439439
sortValue: ({ conditions }) => computeMessage(conditions),
440440
maxWidth: 600,

0 commit comments

Comments
 (0)