Skip to content

Commit 76b516e

Browse files
authored
fix(Toolbar): Fixed null exception in Toolbar filter (#11227)
* fix(Toolbar): Fixed null exception in Toolbar filter * Updates form review comments
1 parent adb27fc commit 76b516e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ class ToolbarFilter extends React.Component<ToolbarFilterProps, ToolbarFilterSta
133133
return (
134134
<React.Fragment>
135135
{showToolbarItem && <ToolbarItem {...props}>{children}</ToolbarItem>}
136-
{ReactDOM.createPortal(labelGroup, labelGroupContentRef.current.firstElementChild)}
136+
{labelGroupContentRef?.current?.firstElementChild !== null &&
137+
ReactDOM.createPortal(labelGroup, labelGroupContentRef.current.firstElementChild)}
137138
</React.Fragment>
138139
);
139140
}

0 commit comments

Comments
 (0)