[Uptime] Console errors in case index missing (#65115)

This commit is contained in:
Shahzad 2020-05-05 15:48:53 +02:00 committed by GitHub
parent 7d15c2103c
commit ba0670d4c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -55,7 +55,13 @@ const statusCount = async (context: QueryContext): Promise<Snapshot> => {
body: statusCountBody(await context.dateAndCustomFilters()),
});
return res.aggregations.counts.value;
return (
res.aggregations?.counts?.value ?? {
total: 0,
up: 0,
down: 0,
}
);
};
const statusCountBody = (filters: any): any => {

View file

@ -47,7 +47,7 @@ export const findPotentialMatches = async (
return {
monitorIds,
checkGroups,
searchAfter: queryResult.aggregations.monitors.after_key,
searchAfter: queryResult.aggregations?.monitors?.after_key,
};
};