Skip to content

Commit c563b01

Browse files
committed
fix: handle if node is undefined
1 parent bae223f commit c563b01

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

electron/renderer/components/grid-item/grid-item.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,15 @@ function separateResizeHandleComponents(nodes: ReactNode): {
8080

8181
if (Array.isArray(nodes)) {
8282
for (const child of nodes) {
83-
if (child.key?.startsWith('resizableHandle-')) {
84-
resizeHandles.push(child);
85-
} else {
86-
children.push(child);
83+
if (child) {
84+
if (child.key?.startsWith('resizableHandle-')) {
85+
resizeHandles.push(child);
86+
} else {
87+
children.push(child);
88+
}
8789
}
8890
}
89-
} else {
91+
} else if (nodes) {
9092
children.push(nodes);
9193
}
9294

0 commit comments

Comments
 (0)