Skip to content

Commit

Permalink
[TSVB] Fixes bug with tophit aggregation and no fields index
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Jul 27, 2021
1 parent 2392b4f commit f79bf86
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ 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 && fields[fieldsSelector] && fields[fieldsSelector].length
? fields[fieldsSelector].find((f) => f.name === model.field)
: {};
const aggWithOptions = getAggWithOptions(field, aggWithOptionsRestrictFields);
const orderOptions = getOrderOptions();

Expand Down

0 comments on commit f79bf86

Please sign in to comment.