From 2ff113c4b143879088f824521b909ee389bb8407 Mon Sep 17 00:00:00 2001 From: biast12 <53872542+biast12@users.noreply.github.com> Date: Sun, 4 Oct 2026 23:53:10 +0200 Subject: [PATCH] Guard Markdown sync after editor destruction Avoids accessing a destroyed editor while synchronizing external Markdown value changes, preventing errors during editor teardown. --- frontend/src/components/MarkdownEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/MarkdownEditor.tsx b/frontend/src/components/MarkdownEditor.tsx index 3a5ebc13..74bcd484 100644 --- a/frontend/src/components/MarkdownEditor.tsx +++ b/frontend/src/components/MarkdownEditor.tsx @@ -229,7 +229,7 @@ const MarkdownEditor: FC = ({ // Sync external value changes (e.g. when loading saved data) useEffect(() => { - if (!editor) return; + if (!editor || editor.isDestroyed) return; const currentMd = getMarkdown(editor.storage); if (value !== currentMd) { editor.commands.setContent(value);