Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ui/public/filter_bar/lib/map_phrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export function FilterBarLibMapPhraseProvider(Promise, indexPatterns) {
const params = isScriptedPhraseFilter ? filter.script.script.params : filter.query.match[key];
const query = isScriptedPhraseFilter ? params.value : params.query;

// Sometimes a filter will end up with an invalid index param. This could happen for a lot of reasons,
// Sometimes a filter will end up with an invalid index or field param. This could happen for a lot of reasons,
// for example a user might manually edit the url or the index pattern's ID might change due to
// external factors e.g. a reindex. We only need the index in order to grab the field formatter, so we fallback
// on displaying the raw value if the index is invalid.
const value = indexPattern ? indexPattern.fields.byName[key].format.convert(query) : query;
// on displaying the raw value if the index or field is invalid.
const value = (indexPattern && indexPattern.fields.byName[key]) ? indexPattern.fields.byName[key].format.convert(query) : query;
return { type, key, value, params };
}

Expand Down