diff --git a/src/checkbox/CheckboxGroup.tsx b/src/checkbox/CheckboxGroup.tsx index 4c27bccee0..eed7e1216f 100644 --- a/src/checkbox/CheckboxGroup.tsx +++ b/src/checkbox/CheckboxGroup.tsx @@ -54,7 +54,7 @@ const CheckboxGroup = (props: ? options : React.Children.map( children, - (child: JSX.Element) => child.type.displayName === Checkbox.displayName && (child as ReactElement).props, + (child: JSX.Element) => child?.type?.displayName === Checkbox.displayName && (child as ReactElement).props, ) || []; const optionsWithoutCheckAll = intervalOptions.filter((t) => typeof t !== 'object' || !t.checkAll);