diff --git a/public/app/features/variables/query/operators.test.ts b/public/app/features/variables/query/operators.test.ts index c3b81000cc6..91f13775402 100644 --- a/public/app/features/variables/query/operators.test.ts +++ b/public/app/features/variables/query/operators.test.ts @@ -290,6 +290,8 @@ describe('areMetricFindValues', () => { ${[{ text: { foo: 1 } }]} | ${false} ${[{ text: Symbol('foo') }]} | ${false} ${[{ text: true }]} | ${false} + ${[{ text: null }]} | ${true} + ${[{ value: null }]} | ${true} ${[]} | ${true} ${[{ text: '' }]} | ${true} ${[{ Text: '' }]} | ${true} diff --git a/public/app/features/variables/query/operators.ts b/public/app/features/variables/query/operators.ts index 5e31cd3b83d..825a651e301 100644 --- a/public/app/features/variables/query/operators.ts +++ b/public/app/features/variables/query/operators.ts @@ -193,7 +193,11 @@ export function areMetricFindValues(data: any[]): data is MetricFindValue[] { continue; } - if (typeof firstValue[firstValueKey] !== 'string' && typeof firstValue[firstValueKey] !== 'number') { + if ( + firstValue[firstValueKey] !== null && + typeof firstValue[firstValueKey] !== 'string' && + typeof firstValue[firstValueKey] !== 'number' + ) { continue; }