Transformations: Prevent FilterByValue transform crashing panel edit (#34747) (#34754)

(cherry picked from commit 515c73d8e6)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-05-26 17:54:22 +02:00
committed by GitHub
co-authored by Jack Westbrook
parent 72b3478935
commit cb9a36b91f
@@ -21,7 +21,7 @@ export const FilterByValueFilterEditor: React.FC<Props> = (props) => {
const { fieldsAsOptions, fieldByDisplayName } = fieldsInfo;
const fieldName = getFieldName(filter, fieldsAsOptions) ?? '';
const field = fieldByDisplayName[fieldName];
const matcherOptions = getMatcherOptions(field);
const matcherOptions = field ? getMatcherOptions(field) : [];
const matcherId = getSelectedMatcherId(filter, matcherOptions);
const editor = valueMatchersUI.getIfExists(matcherId);