ignore dropView method when view is null (#24347)
Summary: In #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 #24346. [Android] [Fixed] - Ignore dropView method when view is null. Pull Request resolved: https://github.com/facebook/react-native/pull/24347 Differential Revision: D14833822 Pulled By: cpojer fbshipit-source-id: 88b6a05090ea8e8d6737c1f10b40e93649fab151
This commit is contained in:
Родитель
7b59c5a47e
Коммит
e5d975b5c7
|
@ -592,6 +592,10 @@ public class NativeViewHierarchyManager {
|
|||
*/
|
||||
protected synchronized void dropView(View view) {
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
if (view == null) {
|
||||
// Ignore this drop operation when view is null.
|
||||
return;
|
||||
}
|
||||
if (mTagsToViewManagers.get(view.getId()) == null) {
|
||||
// This view has already been dropped (likely due to a threading issue caused by async js
|
||||
// execution). Ignore this drop operation.
|
||||
|
|
Загрузка…
Ссылка в новой задаче