Skip to content

Commit

Permalink
Guard against isDestroyed in ManyArray.flushCanonical emberjs#3559
Browse files Browse the repository at this point in the history
  • Loading branch information
jcope2013 committed Aug 20, 2015
1 parent 2f9af0d commit 02efdd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ember-data/lib/system/many-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export default Ember.Object.extend(Ember.MutableArray, Ember.Evented, {
toSet = toSet.concat(newRecords);
var oldLength = this.length;
this.arrayContentWillChange(0, this.length, toSet.length);
this.set('length', toSet.length);
if (!this.isDestroyed) {
this.set('length', toSet.length);
}
this.currentState = toSet;
this.arrayContentDidChange(0, oldLength, this.length);
//TODO Figure out to notify only on additions and maybe only if unloaded
Expand Down

0 comments on commit 02efdd6

Please sign in to comment.