From 86d7e139a4e04732aa89938ce92885bea2b6fb69 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 12 Nov 2019 22:26:25 +0100 Subject: [PATCH] correctly handle 0 notes to erase --- src/services/notes.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/notes.js b/src/services/notes.js index 760524284..cd516eaab 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -450,6 +450,10 @@ async function eraseDeletedNotes() { const noteIdsToErase = await sql.getColumn("SELECT noteId FROM notes WHERE isDeleted = 1 AND isErased = 0 AND notes.utcDateModified <= ?", [dateUtils.utcDateStr(cutoffDate)]); + if (noteIdsToErase.length === 0) { + return; + } + const utcNowDateTime = dateUtils.utcNowDateTime(); const localNowDateTime = dateUtils.localNowDateTime();