Skip to content

Commit

Permalink
Issue #601 - Fix NPE in getResourceLabels function (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmt authored Sep 13, 2018
1 parent 857ac80 commit eff5421
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ export class ApplicationDetails extends React.Component<RouteComponentProps<{ na
labels.push(reason);
}

const allStatuses = resourceNode.state.status.containerStatuses;
const allStatuses = resourceNode.state.status && resourceNode.state.status.containerStatuses || [];
const readyStatuses = allStatuses.filter((s: ContainerStatus) => ('running' in s.state));
const readyContainers = '' + readyStatuses.length + '/' + allStatuses.length + ' containers ready';
const readyContainers = `${readyStatuses.length}/${allStatuses.length} containers ready`;
labels.push(readyContainers);
break;

Expand Down

0 comments on commit eff5421

Please sign in to comment.