From d7f26fa27c7fcc8d22e37911cdc32cd859c29e09 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 8 Jun 2025 20:39:31 +0300 Subject: [PATCH] fix(editor): data loss if updating while editor crashed --- apps/client/src/widgets/type_widgets/editable_text.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/client/src/widgets/type_widgets/editable_text.ts b/apps/client/src/widgets/type_widgets/editable_text.ts index 9331cde17..005ac1ad4 100644 --- a/apps/client/src/widgets/type_widgets/editable_text.ts +++ b/apps/client/src/widgets/type_widgets/editable_text.ts @@ -336,6 +336,11 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget { } getData() { + if (!this.watchdog.editor) { + // There is nothing to save, most likely a result of the editor crashing and reinitializing. + return; + } + const content = this.watchdog.editor?.getData() ?? ""; // if content is only tags/whitespace (typically

 

), then just make it empty,