From 5ed2f712d7b8a76b53ef61a1004126fb6377724e Mon Sep 17 00:00:00 2001 From: Remington Breeze Date: Wed, 2 Jun 2021 14:19:15 -0700 Subject: [PATCH] fix(ui): Crash on application pod view (#6384) 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 76083df804e57..fbcd660b70b9f 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 @@ -284,7 +284,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[]; @@ -315,7 +317,7 @@ export class PodView extends React.Component { fullName: nodeKey(rnode), metadata: {name: rnode.name}, spec: {nodeName: 'Unknown'}, - health: rnode.health.status + health: rnode.health ? rnode.health.status : 'Unknown' } as Pod; // Get node name for Pod