Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(editor): data loss if updating while editor crashed
Elian Dorand7f26fa27c7f
diff --git a/apps/client/src/widgets/type_widgets/editable_text.ts b/apps/client/src/widgets/type_widgets/editable_text.tsindex 9331cde170..005ac1ad40 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 <p> </p>), then just make it empty,