Skip to content

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

fix: return empty array if query is empty

thecodrr906ca1422ca8
diff --git a/packages/core/api/database.js b/packages/core/api/database.js
index c96b767a7..06c4a46af 100644
--- a/packages/core/api/database.js
+++ b/packages/core/api/database.js
@@ -83,6 +83,7 @@ class Database {
* @param {string} query the search query
*/
async searchNotes(query) {
+ if (!query) return [];
//TODO benchmark this and make it faster if necessary
let notes = await this.getNotes();
if (!notes) return;