Fix MountingManager NPE

Summary:
Fix NullPointerException.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D22153157

fbshipit-source-id: 77be1456a2b7f6429d2dce6eac5d9d0bca362c27
This commit is contained in:
Joshua Gross
2020-06-20 17:41:02 -07:00
committed by Facebook GitHub Bot
parent f8bcb1063e
commit 9760a326c9
@@ -455,14 +455,17 @@ public class MountingManager {
}
View view = viewState.mView;
ViewParent parentView = view.getParent();
if (parentView != null) {
throw new IllegalStateException(
"Cannot delete view that is still attached to parent: [" + reactTag + "]");
}
if (view != null) {
ViewParent parentView = view.getParent();
if (parentView != null) {
ReactSoftException.logSoftException(
TAG,
new IllegalStateException(
"Warning: Deleting view that is still attached to parent: [" + reactTag + "]"));
}
dropView(view);
} else {
mTagToViewState.remove(reactTag);