Skip to content

Commit 67a2dd3

Browse files
committed
fix(Toolbar): Fixed null exception in Toolbar filter V5
1 parent 50c26b4 commit 67a2dd3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-core/src/components/Toolbar/ToolbarFilter.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ class ToolbarFilter extends React.Component<ToolbarFilterProps, ToolbarFilterSta
134134
return (
135135
<React.Fragment>
136136
{showToolbarItem && <ToolbarItem {...props}>{children}</ToolbarItem>}
137-
{ReactDOM.createPortal(chipGroup, chipGroupContentRef.current.firstElementChild)}
137+
{chipGroupContentRef &&
138+
chipGroupContentRef?.current !== null &&
139+
chipGroupContentRef.current?.firstElementChild !== null &&
140+
ReactDOM.createPortal(chipGroup, chipGroupContentRef.current.firstElementChild)}
138141
</React.Fragment>
139142
);
140143
}

0 commit comments

Comments
 (0)