Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: fix sqlite crash on calling delete with empty array

Abdullah Attada20e7977aa2
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 {