Skip to content

Commit 82d92ef

Browse files
Artur Chruscielfacebook-github-bot
authored andcommitted
Check if child view != null before dropping (facebook#20465)
Summary: Fixes our top crash when framework try drop a view from parent, but it's a null (already removed etc.). Fixes facebook#20288 Pull Request resolved: facebook#20465 Differential Revision: D10113976 Pulled By: hramos fbshipit-source-id: 34f5654f3bdbc63eb7f7d0b5c94885576fc3cdcd
1 parent 4723c56 commit 82d92ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,9 @@ protected synchronized void dropView(View view) {
570570
ViewGroupManager viewGroupManager = (ViewGroupManager) viewManager;
571571
for (int i = viewGroupManager.getChildCount(viewGroup) - 1; i >= 0; i--) {
572572
View child = viewGroupManager.getChildAt(viewGroup, i);
573-
if (mTagsToViews.get(child.getId()) != null) {
573+
if (child == null) {
574+
FLog.e(TAG, "Unable to drop null child view");
575+
} else if (mTagsToViews.get(child.getId()) != null) {
574576
dropView(child);
575577
}
576578
}

0 commit comments

Comments
 (0)