mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Handle possible null exception on ReactEditText with AppCompat 1.4.0 (#33769)
Summary: This Change fixes a possible null exception as the user uses AppCompat 1.4.0 as a dependency in their App and uses a `TextInput` component. The exception may happen as `mFabricViewStateManager` is accessed during the constructor of the superclass, and is not yet initialized. - For reference, commit #e21f8ec34984551f87a306672160cc88e67e4793 fixes the crash which was already happening. <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> Possible null exception as `mFabricViewStateManager` is accessed during the constructor of the superclass, white it is not yet initialized. This commit #e21f8ec34984551f87a306672160cc88e67e4793 fixes the crash which was already happening, accessing of mFabricViewStateManager before initialization, and left another one of the call of the same nature. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> Fix: accessing `mFabricViewStateManager` before initialization. [JavaScript] [Fixed] - accessing `mFabricViewStateManager` before initialization. Pull Request resolved: https://github.com/facebook/react-native/pull/33769 Test Plan: no external tool was used. Reviewed By: javache Differential Revision: D36205441 Pulled By: cortinico fbshipit-source-id: f3fca69224c7794757514f026a5293b213986186
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2a274c1a08
commit
24a1f5c66c
@@ -642,7 +642,7 @@ public class ReactEditText extends AppCompatEditText
|
||||
// This is hacked in for Fabric. When we delete non-Fabric code, we might be able to simplify or
|
||||
// clean this up a bit.
|
||||
private void addSpansForMeasurement(Spannable spannable) {
|
||||
if (!mFabricViewStateManager.hasStateWrapper()) {
|
||||
if (mFabricViewStateManager != null && !mFabricViewStateManager.hasStateWrapper()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user