Skip to content

Handle possible null exception on ReactEditText with AppCompat 1.4.0#33769

Closed
mikemasam wants to merge 1 commit into
facebook:mainfrom
mikemasam:patch-1
Closed

Handle possible null exception on ReactEditText with AppCompat 1.4.0#33769
mikemasam wants to merge 1 commit into
facebook:mainfrom
mikemasam:patch-1

Conversation

@mikemasam
Copy link
Copy Markdown
Contributor

@mikemasam mikemasam commented May 5, 2022

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.

Summary

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

Fix: accessing mFabricViewStateManager before initialization.

[JavaScript] [Fixed] - accessing mFabricViewStateManager before initialization.

Test Plan

no external tool was used.

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.
@facebook-github-bot
Copy link
Copy Markdown
Contributor

Hi @mikemasam!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@pull-bot
Copy link
Copy Markdown

pull-bot commented May 5, 2022

Messages
📖

📋 Verify Changelog Format - A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

DetailsCATEGORY may be:
  • General
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Generated by 🚫 dangerJS against 17f411d

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,779,145 +90
android hermes armeabi-v7a 7,184,210 +89
android hermes x86 8,088,045 +83
android hermes x86_64 8,068,755 +86
android jsc arm64-v8a 9,653,430 +34
android jsc armeabi-v7a 8,427,208 +35
android jsc x86 9,603,058 +31
android jsc x86_64 10,200,712 +35

Base commit: 018d5cf
Branch: main

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 870755f
Branch: main

@facebook-github-bot
Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 5, 2022
@facebook-github-bot
Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label May 5, 2022
@facebook-github-bot
Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending this over @mikemasam

Related to #31572 for reference

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @mikemasam in 24a1f5c.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants