Skip to content

Commit 5a9c6ec

Browse files
authored
Merge pull request #33931 from abhayinh/fix/tags-filter-undefined
UI: Prevent crash when tag filters contain undefined entries
2 parents 090474e + d20faea commit 5a9c6ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

code/core/src/manager/components/sidebar/TagsFilterPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import { styled } from 'storybook/theming';
1818
import type { Link } from '../../../components/components/tooltip/TooltipLinkList';
1919

2020
export const groupByType = (filters: Filter[]) =>
21-
filters.reduce(
21+
filters.filter(Boolean).reduce(
2222
(acc, filter) => {
23-
acc[filter.type] = acc[filter.type] || [];
23+
acc[filter.type] ??= [];
2424
acc[filter.type].push(filter);
2525
return acc;
2626
},

0 commit comments

Comments
 (0)