-
Notifications
You must be signed in to change notification settings - Fork 75
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
null passed to set method as key argument causes problems #224
Comments
The old way of |
So I think I've managed to track down what conditions cause Say I have a model that contains another model as child property: var User = State.extend({});
var Post = State.extend({
children: {
user: User
}
}); Then I fetch some data from the server where {
"user": null
} Then it comes time to set the Post's user property with //L165
this[attr].set(newVal, options);//attr = "user", newVal = `null` which is where things break. This should demonstrate that A quick fix might be to change |
Gotcha - I'll add a failing test for this and fixup |
Ah @dhritzkiv if you're willing to do a PR that'd be great - pretty busy here today - I appreciate it. |
Yep. Can do. |
Heads up there's a PR for this now from another contributor. Looking into why the travis tests are failing. |
fixed in |
Upon updating my code to v.4.9.0, I started getting errors in
set
about convertingundefined or null to object
.The error happens on L155:
A few lines higher, on L124, there's an explicit check for
null
, and the code also setsattrs
to null:I'm not sure where in my code I'm calling
model.set(null, …)
(it could be happening internally or in another ampersand module), but I'm looking into tracking it down as soon as I submit this issue.The text was updated successfully, but these errors were encountered: