From 2b708560fc002c26f0b09f09cfa451827a3425ac Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Fri, 5 Mar 2021 04:21:51 -0800 Subject: [PATCH] Fix ReactEditText crash Summary: Found this crash when rendering ReactEditText under Venice, from comment it's supposed to be called only in Paper, so I adde a Venice check to avoid calling this method. {F446844248} Changelog: [Android][Changed] - Add a new check to avoid calling this method Reviewed By: mdvacca Differential Revision: D26781457 fbshipit-source-id: f4c2e890156a37e35aa153c736b50924254e67bc --- .../com/facebook/react/views/textinput/ReactEditText.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java index 8e1e74ab845..ba88f16e633 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java @@ -734,8 +734,9 @@ public class ReactEditText extends AppCompatEditText // wrapper 100% of the time. // Since the LocalData object is constructed by getting values from the underlying EditText // view, we don't need to construct one or apply it at all - it provides no use in Fabric. - if (!mFabricViewStateManager.hasStateWrapper()) { - ReactContext reactContext = getReactContext(this); + ReactContext reactContext = getReactContext(this); + + if (!mFabricViewStateManager.hasStateWrapper() && !reactContext.isBridgeless()) { final ReactTextInputLocalData localData = new ReactTextInputLocalData(this); UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); if (uiManager != null) {