Skip to content

Commit

Permalink
fix crash on empty result
Browse files Browse the repository at this point in the history
  • Loading branch information
trinity-1686a committed May 11, 2024
1 parent eae1ed8 commit a609282
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quickwit/quickwit-ui/src/utils/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function extractAggregationResults(aggregation: any): ParsedAggregationRe
if (term_buckets.lenght == 0) {
return null;
}
if (Object.prototype.hasOwnProperty.call(term_buckets[0], "histo_agg")) {
if (term_buckets.length > 0 && Object.prototype.hasOwnProperty.call(term_buckets[0], "histo_agg")) {
// we have a term+histo aggregation
const timestamps_set: Set<number> = new Set();
term_buckets.forEach((bucket: any) => bucket.histo_agg.buckets.forEach(
Expand Down

0 comments on commit a609282

Please sign in to comment.