Skip to content

Commit 8a40dbd

Browse files
authored
Merge pull request #14502 from storybookjs/13687-nonexistent-ids
UI: Skip duplicate storyId breaking sidebar
2 parents 01d3f8f + 7e0385c commit 8a40dbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ui/src/components/sidebar/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const getDescendantIds = memoize(1000)(
3636
(data: StoriesHash, id: string, skipLeafs: boolean): string[] => {
3737
const { children = [] } = data[id] || {};
3838
return children.reduce((acc, childId) => {
39-
if (skipLeafs && data[childId].isLeaf) return acc;
39+
if (!data[childId] || (skipLeafs && data[childId].isLeaf)) return acc;
4040
acc.push(childId, ...getDescendantIds(data, childId, skipLeafs));
4141
return acc;
4242
}, []);

0 commit comments

Comments
 (0)