Skip to content

Commit 1f95ff0

Browse files
authored
Merge pull request scratchfoundation#5026 from chrisgarrity/fix-file-menu
Check for null child before cloning menu item
2 parents c1dcbb0 + dd0c3d7 commit 1f95ff0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/menu/menu.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ MenuItem.propTypes = {
5858

5959

6060
const addDividerClassToFirstChild = (child, id) => (
61-
React.cloneElement(child, {
61+
child && React.cloneElement(child, {
6262
className: classNames(
6363
child.className,
6464
{[styles.menuSection]: id === 0}

0 commit comments

Comments
 (0)