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

fix(realm/Results): provide fallback condition #6955

Closed
wants to merge 2 commits into from

Conversation

guillemsarda
Copy link

What, How & Why?

Small change in the getter length from Results' class.
This solves an issue that causes an app crash when upgrading from react-native: 0.71.2, realm: 11.9.0 and @realm/react: 0.4.3 to the corresponding latest versions.
The issue is solved by providing a fallback condition in the getter (i.e., when this.internal is not defined).

This closes #6954

@cla-bot cla-bot bot added the cla: yes label Jan 8, 2025
@kraenhansen
Copy link
Member

Thanks for your interest in solving this. We've had other users experiencing this issue and another PR trying to fix it.

It is however an invariant of the Results to have an internal value, so instead of handling the possibility of this internal going missing, the proper solution would be to figure out why this internal doesn't have a value in the first place and fix that.

This pattern of internal objects are something we're using lots of places and I don't want to merge a fix for a problem with an undetermined root cause.

@kraenhansen kraenhansen closed this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[React Native] TypeError: Cannot read property 'size' of undefined
3 participants