Skip to content

Commit c20f7f9

Browse files
committed
Fix for soumak77#102 - return false/0 as is instead of null
1 parent 5de228e commit c20f7f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/snapshot.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ function MockDataSnapshot (ref, data, priority) {
1616

1717
MockDataSnapshot.prototype.child = function (key) {
1818
var ref = this.ref.child(key);
19-
var data = this.hasChild(key) ? this._snapshotdata[key] : null;
19+
var data = null;
20+
if (_.isObject(this._snapshotdata) && !_.isUndefined(this._snapshotdata[key])) {
21+
data = this._snapshotdata[key];
22+
}
2023
var priority = this.ref.child(key).priority;
2124
return new MockDataSnapshot(ref, data, priority);
2225
};

0 commit comments

Comments
 (0)