Skip to content

Commit

Permalink
check if there is any result from buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
scampi committed Oct 18, 2016
1 parent 20cbb12 commit b99d6c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ui/public/agg_types/metrics/top_hit.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export default function AggTypeMetricTopProvider(Private) {
}
],
getValue(agg, bucket) {
if (!bucket[agg.id].hits.hits.length) {
return;
}
return bucket[agg.id].hits.hits[0].fields[agg.params.field.name][0];
}
});
Expand Down

0 comments on commit b99d6c7

Please sign in to comment.