Skip to content

Commit

Permalink
Check for parent record before deleting it
Browse files Browse the repository at this point in the history
  • Loading branch information
blt04 authored and Roy Daniels committed Dec 28, 2011
1 parent 6c3f9a7 commit d067a03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ember-datastore/lib/system/store.js
Expand Up @@ -1377,7 +1377,7 @@ Ember.Store = Ember.Object.extend( /** @scope Ember.Store.prototype */ {
prs = this.parentRecords || {};
// first rid of the old parent
oldPk = crs[childStoreKey];
if (oldPk){
if (oldPk && prs[oldPk]){
oldChildren = prs[oldPk];
delete oldChildren[childStoreKey];
// this.recordDidChange(null, null, oldPk, key);
Expand Down

0 comments on commit d067a03

Please sign in to comment.