From b468168567647f696d0cf39f9523fbb6ca8309b0 Mon Sep 17 00:00:00 2001 From: stephenLYZ <750188453@qq.com> Date: Sun, 13 Feb 2022 22:40:41 +0800 Subject: [PATCH] fix(native-filter): fix required Filters of a Dashboard won't load properly --- .../src/dashboard/components/nativeFilters/FilterBar/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx index 6b07c2c7234ab..df6b26ab1d622 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx @@ -238,6 +238,9 @@ const FilterBar: React.FC = ({ const currentTargets = currentFilter.targets; const currentDataMask = currentFilter.defaultDataMask; const previousFilter = previousFilters?.[currentFilter.id]; + if (!previousFilter) { + return; + } const previousType = previousFilter?.filterType; const previousTargets = previousFilter?.targets; const previousDataMask = previousFilter?.defaultDataMask;