make supervisor statistics dialog more robust (#9089)

This commit is contained in:
Vadim Ogievetsky 2019-12-23 17:43:08 -08:00 committed by Clint Wylie
parent 7a7c948595
commit a24e2f347f
1 changed files with 6 additions and 2 deletions

View File

@ -123,9 +123,13 @@ export class SupervisorStatisticsTable extends React.PureComponent<
},
];
if (data && data.length) {
const movingAveragesBuildSegments = deepGet(
data as any,
'0.summary.movingAverages.buildSegments',
);
if (movingAveragesBuildSegments) {
columns = columns.concat(
Object.keys(deepGet(data[0], 'summary.movingAverages.buildSegments'))
Object.keys(movingAveragesBuildSegments)
.sort((a, b) => a.localeCompare(b, undefined, { numeric: true }))
.map(
(interval: string): Column<TableRow> => {