Skip to content

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

fix: crash when there's no data in db

thecodrr5d766448a676
diff --git a/packages/core/database/cached-collection.js b/packages/core/database/cached-collection.js
index f5c24317a..a0a77b83f 100644
--- a/packages/core/database/cached-collection.js
+++ b/packages/core/database/cached-collection.js
@@ -11,7 +11,7 @@ export default class CachedCollection {
async init() {
await this.indexer.init();
const data = await this.indexer.readMulti(this.indexer.indices);
- this.map = new Map(data);
+ if (data.length > 0) this.map = new Map(data);
}
/**