Skip to content

Commit

Permalink
[TSVB] Fixes bug with tophit aggregation and index not exist (#106814)
Browse files Browse the repository at this point in the history
* [TSVB] Fixes bug with tophit aggregation and no fields index

* Update src/plugins/vis_type_timeseries/public/application/components/aggs/top_hit.js

Co-authored-by: Alexey Antonov <[email protected]>

* Apply review comments

Co-authored-by: Alexey Antonov <[email protected]>
  • Loading branch information
stratoula and alexwizp authored Jul 28, 2021
1 parent f67737d commit 4b8b103
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const TopHitAggUi = (props) => {
const handleSelectChange = createSelectHandler(handleChange);
const handleTextChange = createTextHandler(handleChange);
const fieldsSelector = getIndexPatternKey(indexPattern);
const field = fields[fieldsSelector].find((f) => f.name === model.field);
const field = fields?.[fieldsSelector]?.find((f) => f.name === model.field);
const aggWithOptions = getAggWithOptions(field, aggWithOptionsRestrictFields);
const orderOptions = getOrderOptions();

Expand Down

0 comments on commit 4b8b103

Please sign in to comment.