Skip to content

Commit 461fa11

Browse files
authored
fix(common/providers/database): DataSnapshot.val() throwing error when source is null (#1682)
1 parent cce55b5 commit 461fa11

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/common/providers/database.ts

+3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ export class DataSnapshot implements database.DataSnapshot {
126126
val(): any {
127127
const parts = pathParts(this._childPath);
128128
let source = this._data;
129+
if (source === null) {
130+
return null;
131+
}
129132
if (parts.length) {
130133
for (const part of parts) {
131134
if (source[part] === undefined) {

0 commit comments

Comments
 (0)