From 585398ad5cb5cb0a3762a0aab28811598191d2c5 Mon Sep 17 00:00:00 2001 From: azivner Date: Mon, 19 Nov 2018 23:11:36 +0100 Subject: [PATCH] fix bug when saving non-text notes --- src/services/consistency_checks.js | 10 ++++++++++ src/services/notes.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/services/consistency_checks.js b/src/services/consistency_checks.js index e459b83ac..b79c69d4b 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 5323a3232..a4afa98a7 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 = [];