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

Nullify handling for toMany relationships. #945

Merged

Conversation

recurve
Copy link
Contributor

@recurve recurve commented Apr 10, 2021

toMany relationships should always have an empty array. There was a bug here where we set that array to null which will surprise people. People expecting to have an empty array will have a null pointer instead without this fix.

Note: It is important to set a Mutable array because that's what it is internally even though the Apple/NeXT API shows immutable getters. If you think about it, this makes sense. They don't want you adding/remove directly from the array but internally the data structure needs to be mutable.

Signed-off-by: Aaron Rosenzweig aaron@chatnbike.com

toMany relationships should always have an empty array. There was a bug here where we set that array to null which will surprise people. People expecting to have an empty array will have a null pointer instead without this fix.

Signed-off-by: Aaron Rosenzweig <aaron@chatnbike.com>
@rparada
Copy link
Contributor

rparada commented Apr 29, 2021

Is this going to be merged? I've been using it with great success. Thanks!

@darkv
Copy link
Member

darkv commented Apr 29, 2021

There you go :)

@darkv darkv merged commit c8975c1 into wocommunity:master Apr 29, 2021
@rparada
Copy link
Contributor

rparada commented Apr 29, 2021

Thank you Johann

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.

3 participants