Skip to content

Commit 6ad1edb

Browse files
authored
fix(uncontrolled-tree-env): add additonal optional chaining for undefined (#356)
1 parent 722dcaf commit 6ad1edb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/uncontrolledEnvironment/UncontrolledTreeEnvironment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const UncontrolledTreeEnvironment = React.forwardRef<
132132
// move old items out
133133
for (const item of items) {
134134
const parent = Object.values(currentItems).find(potentialParent =>
135-
potentialParent.children?.includes(item.index)
135+
potentialParent?.children?.includes?.(item.index)
136136
);
137137

138138
if (!parent) {

0 commit comments

Comments
 (0)