mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-16 08:19:47 +08:00
Check if child view != null before dropping (#20465)
Summary: Fixes our top crash when framework try drop a view from parent, but it's a null (already removed etc.). Fixes #20288 Pull Request resolved: https://github.com/facebook/react-native/pull/20465 Differential Revision: D10113976 Pulled By: hramos fbshipit-source-id: 34f5654f3bdbc63eb7f7d0b5c94885576fc3cdcd
This commit is contained in:
committed by
Facebook Github Bot
parent
e082a61324
commit
af181fb192
@@ -570,7 +570,9 @@ public class NativeViewHierarchyManager {
|
||||
ViewGroupManager viewGroupManager = (ViewGroupManager) viewManager;
|
||||
for (int i = viewGroupManager.getChildCount(viewGroup) - 1; i >= 0; i--) {
|
||||
View child = viewGroupManager.getChildAt(viewGroup, i);
|
||||
if (mTagsToViews.get(child.getId()) != null) {
|
||||
if (child == null) {
|
||||
FLog.e(TAG, "Unable to drop null child view");
|
||||
} else if (mTagsToViews.get(child.getId()) != null) {
|
||||
dropView(child);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user