mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
27b3aecb3d
commit
40f6998b67
@@ -128,6 +128,9 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
|
||||
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")) {
|
||||
|
||||
Reference in New Issue
Block a user