Skip to content

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

fix: init map instance when cachedcollection is made

thecodrrdfa612ab84cc
diff --git a/packages/core/database/cached-collection.js b/packages/core/database/cached-collection.js
index 4fbe64c98..849f4c25f 100644
--- a/packages/core/database/cached-collection.js
+++ b/packages/core/database/cached-collection.js
@@ -6,7 +6,7 @@ export default class CachedCollection extends IndexedCollection {
constructor(context, type) {
super(context, type);
this.type = type;
- this.map;
+ this.map = new Map();
}
async init() {
@@ -44,7 +44,6 @@ export default class CachedCollection extends IndexedCollection {
}
getRaw() {
- if (!this.map) return [];
return Array.from(this.map.values());
}