From f43a6ad2aa5064cb768dc5ddcee7eefd65025da6 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 1d1133dcd186f..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 @@ -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 ? rnode.health.status : 'Unknown' } as Pod; // Get node name for Pod