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

Commit 99fbb40

Browse files
ulionJacob Wenger
authored andcommitted
Fix firebaseObject destroyed caused delayed on('value') update failure. (#888)
1 parent 84056b5 commit 99fbb40

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/database/FirebaseObject.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,13 @@
461461
var isResolved = false;
462462
var def = $q.defer();
463463
var applyUpdate = $firebaseUtils.batch(function(snap) {
464-
var changed = firebaseObject.$$updated(snap);
465-
if( changed ) {
466-
// notifies $watch listeners and
467-
// updates $scope if bound to a variable
468-
firebaseObject.$$notify();
464+
if (firebaseObject) {
465+
var changed = firebaseObject.$$updated(snap);
466+
if( changed ) {
467+
// notifies $watch listeners and
468+
// updates $scope if bound to a variable
469+
firebaseObject.$$notify();
470+
}
469471
}
470472
});
471473
var error = $firebaseUtils.batch(function(err) {

0 commit comments

Comments
 (0)