Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit 1df36fe

Browse files
fix(database): only allow non null values from localforage
related: #23 thanks: @rodrifmed
1 parent abeb837 commit 1df36fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/database.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ export class AngularFireOfflineDatabase {
199199
});
200200
// Local
201201
this.localForage.getItem(`read/object${key}`).then(value => {
202-
if (!this.objectCache[key].loaded) {
203-
const cacheValue = unwrap(key.split('/').pop(), value, () => value !== null);
202+
if (!this.objectCache[key].loaded && value !== null) {
203+
const cacheValue = unwrap(key.split('/').pop(), value, () => true);
204204
if (this.processing.current) {
205205
this.processing.objectCache[key] = cacheValue;
206206
} else {

0 commit comments

Comments
 (0)