Skip to content

Conversation

alexanderott
Copy link

Avoid parsing problem on an empty relation.

@@ -150,7 +150,9 @@

_.each(this.relations, function(rel, key) {
if (_.has(attrs, key)) {
attrs[key] = attrs[key].toJSON();
if(attrs[key] !== null) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexanderott thanks for the PR! I don't actively use this package anymore, so I don't know if this would be correct as you have done it, or would it be better to move the conditional up to the previous statement:

if (_.has(attrs, key) && attrs[key] !== null) {

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