diff --git a/src/components/common/ckeditor/TextEditor.jsx b/src/components/common/ckeditor/TextEditor.jsx index e7ba4ee..7e24beb 100644 --- a/src/components/common/ckeditor/TextEditor.jsx +++ b/src/components/common/ckeditor/TextEditor.jsx @@ -369,12 +369,12 @@ export default function TextEditor(props) { ); }} onAfterDestroy={() => { - Array.from(editorToolbarRef.current.children).forEach( - (child) => child.remove(), - ); - Array.from(editorMenuBarRef.current.children).forEach( - (child) => child.remove(), - ); + Array.from( + editorToolbarRef.current?.children || [], + ).forEach((child) => child.remove()); + Array.from( + editorMenuBarRef.current?.children || [], + ).forEach((child) => child.remove()); }} editor={DecoupledEditor} config={editorConfig}