From da20e7977aa2da576d695b705b13222a0a754a5d Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Thu, 22 Feb 2024 23:05:40 +0500 Subject: [PATCH] core: fix sqlite crash on calling delete with empty array --- packages/core/src/collections/notes.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/src/collections/notes.ts b/packages/core/src/collections/notes.ts index b3b48bf0f..61a684f91 100644 --- a/packages/core/src/collections/notes.ts +++ b/packages/core/src/collections/notes.ts @@ -351,6 +351,8 @@ export class Notes implements ICollection { } private async _delete(moveToTrash = true, ...ids: string[]) { + if (ids.length <= 0) return; + if (moveToTrash) { await this.db.trash.add("note", ids); } else {