Skip to content

Commit

Permalink
Add null check for empty process data (#89187)
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipb authored Jan 25, 2021
1 parent 14fa82d commit 2ae2692
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions x-pack/plugins/infra/server/lib/host_details/process_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@ export const getProcessList = async (
command: bucket.key,
};
});
const {
summary,
} = result.aggregations!.summaryEvent.summary.hits.hits[0]._source.system.process;

let summary: { [p: string]: number } = {};
if (result.aggregations!.summaryEvent.summary.hits.hits.length) {
summary = result.aggregations!.summaryEvent.summary.hits.hits[0]._source.system.process
.summary;
}

return {
processList,
Expand Down

0 comments on commit 2ae2692

Please sign in to comment.