Skip to content

Commit

Permalink
fix(ui): Prevent UI crash if app status or resources is empty (#6858)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbreeze authored Jul 30, 2021
1 parent 17bef1c commit bee20c2
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,7 @@ export class PodView extends React.Component<PodViewProps> {
}

const statusByKey = new Map<string, ResourceStatus>();
if (this.props.app) {
this.props.app.status.resources.forEach(res => statusByKey.set(nodeKey(res), res));
}
this.props.app.status?.resources?.forEach(res => statusByKey.set(nodeKey(res), res));
(tree.nodes || []).forEach((rnode: ResourceTreeNode) => {
// make sure each node has not null/undefined parentRefs field
rnode.parentRefs = rnode.parentRefs || [];
Expand Down

0 comments on commit bee20c2

Please sign in to comment.