Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resetting locals to undefined triggers a setter with an (undefined)record argument #355

Closed
agonbina opened this issue Jun 17, 2016 · 0 comments

Comments

@agonbina
Copy link

agonbina commented Jun 17, 2016

... the setter then tries to access attributes in the passed in record which ends up in throwing an exception.
https://github.com/js-data/js-data/blob/master/src/DataStore.js#L442, which triggers a setter(this block: https://github.com/js-data/js-data/blob/master/src/DataStore.js#L598-L630) with an undefined value, so this line here throws: https://github.com/js-data/js-data/blob/master/src/DataStore.js#L604 because record is undefined ...
Replacing utils.set(https://github.com/js-data/js-data/blob/master/src/DataStore.js#L442) with safeSet fixes the issue.

@agonbina agonbina changed the title Resetting locals to undefined triggers a setter which tries to access attributes in the empty (undefined)record argument Resetting locals to undefined triggers a setter with an (undefined)record argument Jun 17, 2016
@jmdobry jmdobry self-assigned this Jun 17, 2016
@jmdobry jmdobry added this to the 3.0 beta milestone Jun 17, 2016
@jmdobry jmdobry added the done label Jun 21, 2016
jmdobry added a commit that referenced this issue Jun 21, 2016
@jmdobry jmdobry closed this as completed Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants