Skip to content

Build your personal knowledge base with Trilium Notes

fix null content when protecting notes, closes #3523

zadam2525857c2062
diff --git a/src/services/notes.js b/src/services/notes.js
index 813e75bc64..c361b05425 100644
--- a/src/services/notes.js
+++ b/src/services/notes.js
@@ -286,8 +286,10 @@ function protectNote(note, protect) {
note.isProtected = protect;
- // this will force de/encryption
- note.setContent(content);
+ if (content !== null) { // see https://github.com/zadam/trilium/issues/3523
+ // this will force de/encryption
+ note.setContent(content);
+ }
note.save();
}