mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
getChildAtWithSubviewClippingEnabled should be @Nullable
Summary: The RemoveDeleteTree operation assumes it can safely call getChildAt with indices that are out of bounds to find all the children. `getChildAtWithSubviewClippingEnabled` was unnecessarily stricter than `getChildAt` and would crash in such cases. Changelog: [Android][Fixed] - Fix crash in `getChildAtWithSubviewClippingEnabled` Reviewed By: NickGerleman Differential Revision: D54380975 fbshipit-source-id: 17e93c685cd07b02dc20efa2fae89090d6e38457
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4d2262b8d2
commit
d6a44e632a
+5
-2
@@ -637,8 +637,11 @@ public class ReactViewGroup extends ViewGroup
|
||||
return mAllChildrenCount;
|
||||
}
|
||||
|
||||
/*package*/ View getChildAtWithSubviewClippingEnabled(int index) {
|
||||
return Assertions.assertNotNull(mAllChildren)[index];
|
||||
/*package*/ @Nullable
|
||||
View getChildAtWithSubviewClippingEnabled(int index) {
|
||||
return index >= 0 && index < mAllChildrenCount
|
||||
? Assertions.assertNotNull(mAllChildren)[index]
|
||||
: null;
|
||||
}
|
||||
|
||||
/*package*/ void addViewWithSubviewClippingEnabled(View child, int index) {
|
||||
|
||||
Reference in New Issue
Block a user