Permalink
Browse files

added a null check on accessibilityStates

Summary:
Added a check for null on `accessibilityStates`.
Now, if a null value is passed in to the prop, it simply does not do anything.

Reviewed By: achen1

Differential Revision: D9034714

fbshipit-source-id: caffa41a1d8b08d5358d085e4e268e8e6f1c9344
  • Loading branch information...
ziqichen6 authored and facebook-github-bot committed Jul 27, 2018
1 parent 27b3aec commit 40f6998b6766e8aa3c038a1416e5c62cbafca109
Showing with 3 additions and 0 deletions.
  1. +3 −0 ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java
@@ -128,6 +128,9 @@ public void setAccessibilityRole(T view, String accessibilityRole) {
public void setViewStates(T view, ReadableArray accessibilityStates) {
view.setSelected(false);
view.setEnabled(true);
if (accessibilityStates == null) {
return;
}
for (int i = 0; i < accessibilityStates.size(); i++) {
String state = accessibilityStates.getString(i);
if (state.equals("selected")) {

0 comments on commit 40f6998

Please sign in to comment.