Skip to content

Commit 032c22d

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Return NONE accessibility role if null is passed. (#38613)
Summary: Pull Request resolved: #38613 The `value` string of the ReactAccessibilityDelegate's `fromValue` method is marked as `Nullable`, however the `null` case is not handled. This change handle the `null` case setting the accesssibility role to NONE. ## Changelog: [Android][Fixed] - Set the accessibility role to `NONE` when a `null` string is passed to `fromValue` Reviewed By: cortinico Differential Revision: D47752098 fbshipit-source-id: 075972ccc7bdbed8737f2c3a27add0cc398ef1d4
1 parent e64756a commit 032c22d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ public static String getValue(AccessibilityRole role) {
295295
}
296296

297297
public static AccessibilityRole fromValue(@Nullable String value) {
298+
if (value == null) {
299+
return NONE;
300+
}
301+
298302
for (AccessibilityRole role : AccessibilityRole.values()) {
299303
if (role.name().equalsIgnoreCase(value)) {
300304
return role;

0 commit comments

Comments
 (0)