Skip to content

Commit dea5eae

Browse files
7772zhongwuzw
authored andcommitted
ignore dropView method when view is null (facebook#24347)
Summary: In facebook#20288, we solved `com.facebook.react.uimanager.NativeViewHierarchyManager.dropView (NativeViewHierarchyManager.java:536)` by adding codes that prevent to run method on `view` object when `view.getId()` is null. But if `view` is null, `view.getId()` can make error about NullPointerException. So, I think `dropView` method needs to check if `view` is null. If you need more information, Please read facebook#24346. [Android] [Fixed] - Ignore dropView method when view is null. Pull Request resolved: facebook#24347 Differential Revision: D14833822 Pulled By: cpojer fbshipit-source-id: 88b6a05090ea8e8d6737c1f10b40e93649fab151
1 parent 6ba43cb commit dea5eae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,10 @@ protected synchronized final void addRootViewGroup(int tag, View view) {
592592
*/
593593
protected synchronized void dropView(View view) {
594594
UiThreadUtil.assertOnUiThread();
595+
if (view == null) {
596+
// Ignore this drop operation when view is null.
597+
return;
598+
}
595599
if (mTagsToViewManagers.get(view.getId()) == null) {
596600
// This view has already been dropped (likely due to a threading issue caused by async js
597601
// execution). Ignore this drop operation.

0 commit comments

Comments
 (0)