We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaecf9c commit ccf3616Copy full SHA for ccf3616
database/helpers/index.ts
@@ -7,6 +7,10 @@ export const snapshotToData = (
7
snapshot: database.DataSnapshot,
8
keyField?: string
9
) => {
10
+ if (!snapshot.exists) {
11
+ return null;
12
+ }
13
+
14
const val = snapshot.val();
15
if (isObject(val)) {
16
return {
firestore/helpers/index.ts
@@ -4,7 +4,10 @@ export const snapshotToData = (
4
snapshot: firestore.DocumentSnapshot,
5
idField?: string
6
- if (!snapshot.exists) return null;
...snapshot.data(),
...(idField ? { [idField]: snapshot.id } : null),
0 commit comments