fix: do not get undefined items

This commit is contained in:
thecodrr
2020-04-21 12:23:51 +05:00
parent f9f7e3471d
commit 1c253b2170
2 changed files with 7 additions and 1 deletions

View File

@@ -79,7 +79,7 @@ export default class CachedCollection {
getAllItems(sortFn = (u) => u.dateCreated) {
let items = [];
this.map.forEach((value) => {
if (value.deleted) return;
if (!value || value.deleted) return;
items[items.length] = value;
});
return sort(items).desc(sortFn);