Skip to content

Commit

Permalink
Check if child view != null before dropping (facebook#20465)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Artur Chrusciel authored and facebook-github-bot committed Sep 28, 2018
1 parent 4723c56 commit 82d92ef
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,9 @@ protected synchronized void dropView(View view) {
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);
}
}
Expand Down

0 comments on commit 82d92ef

Please sign in to comment.