Skip to content

Build your personal knowledge base with Trilium Notes

Merge branch 'master' into next50

zadam96f4230bc1e3
diff --cc src/services/notes.js
index f35706a2ff,c7cd68b3db..304b406dcc
--- a/src/services/notes.js
+++ b/src/services/notes.js
@@@ -104,14 -102,11 +104,15 @@@ function createNewNote(params)
throw new Error(`Parent note "${params.parentNoteId}" not found.`);
}
- if (!params.title || params.title.trim().length === 0) {
- throw new Error(`Note title must not be empty`);
+ if (params.title === null || params.title === undefined) {
+ // empty title is allowed since it's possible to create such in the UI
+ throw new Error(`Note title must be set`);
}
+ if (params.content === null || params.content === undefined) {
+ throw new Error(`Note content must be set`);
+ }
+
return sql.transactional(() => {
const note = new Note({
noteId: params.noteId, // optionally can force specific noteId