diff --git a/superset-frontend/src/filters/components/Adhoc/AdhocFilterPlugin.tsx b/superset-frontend/src/filters/components/Adhoc/AdhocFilterPlugin.tsx index fa35962cc861d..66883455e7405 100644 --- a/superset-frontend/src/filters/components/Adhoc/AdhocFilterPlugin.tsx +++ b/superset-frontend/src/filters/components/Adhoc/AdhocFilterPlugin.tsx @@ -54,7 +54,7 @@ type DataMaskAction = filterState: { label?: string; filters?: AdhocFilter[]; - value: AdhocFilter[]; + value?: AdhocFilter[]; }; }; @@ -182,13 +182,15 @@ export default function PluginFilterAdhoc(props: PluginFilterAdhocProps) { ), filterState: { ...filterState, - label: (adhoc_filters || []) - .map(f => - f.sqlExpression ? String(f.sqlExpression) : labelString(f), - ) - .join(', '), - value: adhoc_filters, - filters: adhoc_filters, + label: adhoc_filters?.length + ? (adhoc_filters || []) + .map(f => + f.sqlExpression ? String(f.sqlExpression) : labelString(f), + ) + .join(', ') + : undefined, + value: adhoc_filters?.length ? adhoc_filters : undefined, + filters: adhoc_filters?.length ? adhoc_filters : undefined, }, }); },