From fb595a16bfd9b07ad9fe782c6d145afe1337edc2 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sun, 1 Feb 2026 22:47:33 +0000 Subject: [PATCH] Fixed console error when unmounting ckeditor --- src/components/common/ckeditor/TextEditor.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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}