Skip to content

Conversation

@ninoreiter
Copy link

Ember 2.0 changed the behavior of Ember.get(obj, keyName). If obj is undefined or null, older versions of Ember return undefined. With the changes of Ember 2.0 this behavior changed and an exception is been thrown. This exception can be reproduced when no item is selected (selection = null).
The changes restore the old behavior of Ember.get by wrapping it in the method _getWithExceptionHandling.

See issue #91

@miguelcobain
Copy link
Owner

@ninoraubaum I think that testing obj instead would be more idiomatic. Something like:

_get(obj, keyName) {
  if (obj) { return get(obj, keyName); }
  else { return undefined; }
}

Do you agree, and if so, would you mind updating the PR?
Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants