From 358896a49f2e96118c6a158480eb65c4da0d21cc Mon Sep 17 00:00:00 2001 From: Remington Breeze Date: Wed, 2 Jun 2021 13:04:36 -0700 Subject: [PATCH 1/2] fix(ui): Crash on application pod view Signed-off-by: Remington Breeze --- .../components/application-pod-view/pod-view.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/src/app/applications/components/application-pod-view/pod-view.tsx b/ui/src/app/applications/components/application-pod-view/pod-view.tsx index 1d1133dcd186f..f176f620263ff 100644 --- a/ui/src/app/applications/components/application-pod-view/pod-view.tsx +++ b/ui/src/app/applications/components/application-pod-view/pod-view.tsx @@ -304,7 +304,9 @@ export class PodView extends React.Component { } const statusByKey = new Map(); - this.props.app.status.resources.forEach(res => statusByKey.set(nodeKey(res), res)); + if (this.props.app) { + this.props.app.status.resources.forEach(res => statusByKey.set(nodeKey(res), res)); + } (tree.nodes || []).forEach((rnode: ResourceTreeNode) => { if (sortMode !== 'node') { parentsFor[rnode.uid] = rnode.parentRefs as PodGroup[]; @@ -335,7 +337,7 @@ export class PodView extends React.Component { fullName: nodeKey(rnode), metadata: {name: rnode.name}, spec: {nodeName: 'Unknown'}, - health: rnode.health.status + health: rnode.health?.status || 'Unknown' } as Pod; // Get node name for Pod From a9566dfb972189f3cdebe44a75c1b4cd1383484a Mon Sep 17 00:00:00 2001 From: Remington Breeze Date: Wed, 2 Jun 2021 13:16:45 -0700 Subject: [PATCH 2/2] Lint Signed-off-by: Remington Breeze --- .../applications/components/application-pod-view/pod-view.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/app/applications/components/application-pod-view/pod-view.tsx b/ui/src/app/applications/components/application-pod-view/pod-view.tsx index f176f620263ff..d1be49e63a821 100644 --- a/ui/src/app/applications/components/application-pod-view/pod-view.tsx +++ b/ui/src/app/applications/components/application-pod-view/pod-view.tsx @@ -337,7 +337,7 @@ export class PodView extends React.Component { fullName: nodeKey(rnode), metadata: {name: rnode.name}, spec: {nodeName: 'Unknown'}, - health: rnode.health?.status || 'Unknown' + health: rnode.health ? rnode.health.status : 'Unknown' } as Pod; // Get node name for Pod