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

[BUGFIX] initial-relationship-setup must handle null #4910

Merged
merged 2 commits into from
Mar 31, 2017

Conversation

runspired
Copy link
Contributor

No description provided.

this.members.add(internalModel);
this.setupInverseRelationship(internalModel);
});
if (internalModels && internalModels.length) {
Copy link
Member

Choose a reason for hiding this comment

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

Why would it be true but not have a length?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was just being overly cautious

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have only ever hit undefined or an array with items in practice

Copy link
Member

Choose a reason for hiding this comment

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

If it's not undefined but has no length, l think we are in a bad state. We should assert against that in debug maybe, but we shouldn't guard, that would just hide a bug

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dropped the length check, I suspect asserting length here would be asserting at the wrong layer.

@igorT igorT merged commit ab35b2d into emberjs:master Mar 31, 2017
@stefanpenner stefanpenner deleted the fix/null-relationships branch August 13, 2017 00:47
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