Skip to content

Commit bd23462

Browse files
committed
Better fix for calling DataSnapshot#val() with null data
1 parent c573ff7 commit bd23462

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/providers/database.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class DataSnapshot implements database.DataSnapshot {
128128
let source = this._data;
129129
if (parts.length) {
130130
for (const part of parts) {
131-
if (source[part] === undefined || source[part] === null) {
131+
if (typeof source === "undefined" || source === null) {
132132
return null;
133133
}
134134
source = source[part];

0 commit comments

Comments
 (0)