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

[Fabric] [iOS] Fix app crash when selecting an empty value #567

Conversation

bernhardoj
Copy link
Contributor

@bernhardoj bernhardoj commented May 17, 2024

Selecting an item with an empty value crashes the app because we convert an empty string to null,

dictItem[@"value"] = RCTNSStringFromStringNilIfEmpty(item.value);

and it crashes here.

.newValue = RCTStringFromNSString(RCTNullIfNil(_items[row][@"value"])),

Test

  1. Run the example app with RCT_NEW_ARCH_ENABLED enabled
  2. Add a picker item with an empty value to the example
  3. Scroll the picker to select the item with an empty value

Copy link
Contributor

@Naturalclar Naturalclar left a comment

Choose a reason for hiding this comment

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

LGTM!

@Naturalclar Naturalclar merged commit 09026e1 into react-native-picker:master May 19, 2024
6 of 12 checks passed
@Naturalclar
Copy link
Contributor

🎉 This PR is included in version 2.7.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bernhardoj
Copy link
Contributor Author

Great, thanks!

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.

None yet

2 participants