Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit c53b2e9

Browse files
committed
Also distinguish between objects and arrays correctly
1 parent 65e262e commit c53b2e9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

angularFire.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ AngularFire.prototype = {
3434
self._remoteValue = ret;
3535
if (snap && snap.val()) {
3636
var val = snap.val();
37-
if (typeof snap.val() != typeof ret) {
37+
if (typeof val != typeof ret) {
38+
self._fRef.set(null);
39+
return;
40+
}
41+
// Also distinguish between objects and arrays.
42+
var check = Object.prototype.toString;
43+
if (check.call(ret) != check.call(val)) {
3844
self._fRef.set(null);
3945
return;
4046
}

0 commit comments

Comments
 (0)