From 3ead84d47dde15a2db446c73b53646f802e6458f Mon Sep 17 00:00:00 2001 From: Remco Date: Wed, 14 Jul 2021 11:49:42 +0200 Subject: [PATCH] return undefined when doc doesn't exist --- projects/akita-ng-fire/src/lib/utils/query/await-sync-query.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/akita-ng-fire/src/lib/utils/query/await-sync-query.ts b/projects/akita-ng-fire/src/lib/utils/query/await-sync-query.ts index 17c56d1..93077ad 100644 --- a/projects/akita-ng-fire/src/lib/utils/query/await-sync-query.ts +++ b/projects/akita-ng-fire/src/lib/utils/query/await-sync-query.ts @@ -106,7 +106,7 @@ export function awaitQuery> const { id } = getIdAndPath({ path }); return this['db'].doc(path).valueChanges().pipe( switchMap(entity => getAllSubQueries(query, entity)), - map(entity => ({ id, ...entity })) + map(entity => entity ? ({ id, ...entity }) : undefined) ); } // IF COLLECTION