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

Update RNCSliderComponentView.mm #682

Merged
merged 1 commit into from
Feb 14, 2025
Merged

Conversation

ckknight
Copy link
Contributor

Summary:

This fixes a NSInvalidArgumentException which causes a full app crash when <Slider accessibilityIncrements={['anything non-empty array']} /> is rendered, by initializing an NSMutableArray instead of an NSArray, as it called with addObject: if accessibilityIncrements is non-empty.

Test Plan:

In iOS,

Render <Slider minimumValue={1} maximumValue={3} accessibilityIncrements={['alfa', 'bravo', 'charlie']} />

See if it crashes or not


Android should have no behavioral differences.

This fixes a NSInvalidArgumentException which causes a full app crash when `<Slider accessibilityIncrements={['anything non-empty array']} />` is rendered, by initializing an NSMutableArray instead of an NSArray, as it called with `addObject:` if `accessibilityIncrements` is non-empty.
@BartoszKlonowski BartoszKlonowski self-requested a review February 14, 2025 11:52
Copy link
Member

@BartoszKlonowski BartoszKlonowski left a comment

Choose a reason for hiding this comment

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

Thank you for this, @ckknight! 👍

@BartoszKlonowski BartoszKlonowski merged commit 0cb2234 into callstack:main Feb 14, 2025
9 checks passed
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