Skip to content

Commit c856c0c

Browse files
committed
safeguard meta data assignment
1 parent 869f5fd commit c856c0c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • packages/compat/src/components/Toolbar

packages/compat/src/components/Toolbar/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ const Toolbar = forwardRef<HTMLDivElement, ToolbarPropTypes>((props, ref) => {
212212
return (
213213
<div
214214
ref={(node) => {
215-
controlMetaData.current[index].ref.current = node;
215+
if (controlMetaData.current[index]) {
216+
controlMetaData.current[index].ref.current = node;
217+
}
216218
}}
217219
key={index}
218220
className={classNames.childContainer}

0 commit comments

Comments
 (0)