Skip to content

Commit e689e25

Browse files
authored
Merge pull request #2333 from weaveworks/2332-handle-500
Fix undefined clusterName in link format func
2 parents 062b675 + 7516f8f commit e689e25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ export function formatClusterDashboardUrl(clusterName: string): string {
66
if (clusterName === 'management') return '';
77
// clusterName includes namespace in manay places across the console
88
// Taking in consideration that cluster Name doesn't contain any / separator
9+
10+
if (!clusterName) {
11+
// https://github.com/weaveworks/weave-gitops-enterprise/issues/2332
12+
return '';
13+
}
14+
915
const cls = clusterName.split('/');
1016
let url = cls[0];
1117
if (cls.length > 1) {

0 commit comments

Comments
 (0)