Skip to content

Build your personal knowledge base with Trilium Notes

fix bug when saving non-text notes

azivner585398ad5cb5
diff --git a/src/services/consistency_checks.js b/src/services/consistency_checks.js
index e459b83ac1..b79c69d4b4 100644
--- a/src/services/consistency_checks.js
+++ b/src/services/consistency_checks.js
@@ -209,6 +209,16 @@ async function runAllChecks() {
AND type != 'relation-map'`,
"Note has invalid type", errorList);
+ await runCheck(`
+ SELECT
+ noteId
+ FROM
+ notes
+ WHERE
+ isDeleted = 0
+ AND content IS NULL`,
+ "Note content is null even though it is not deleted", errorList);
+
await runCheck(`
SELECT
parentNoteId
diff --git a/src/services/notes.js b/src/services/notes.js
index 5323a3232f..a4afa98a76 100644
--- a/src/services/notes.js
+++ b/src/services/notes.js
@@ -219,7 +219,7 @@ function findRelationMapLinks(content, foundLinks) {
async function saveLinks(note, content) {
if (note.type !== 'text' && note.type !== 'relation-map') {
- return;
+ return content;
}
const foundLinks = [];