Skip to content

Add null check for instance manager#45549

Closed
Abbondanzo wants to merge 1 commit into
facebook:mainfrom
Abbondanzo:export-D59982179
Closed

Add null check for instance manager#45549
Abbondanzo wants to merge 1 commit into
facebook:mainfrom
Abbondanzo:export-D59982179

Conversation

@Abbondanzo
Copy link
Copy Markdown
Contributor

Summary:

Summary

Calling getCurrentReactContext on an unmounted ReactRootView could lead to a NPE. The method currently returns a nullable value so return type is the exact same. This change checks if the react instance manager is present and returns null early if not.

Changelog:

[Android] [Fixed] - Adds a null check in react context getter

Differential Revision: D59982179

Summary:
## Summary
Calling `getCurrentReactContext` on an unmounted `ReactRootView` could lead to a NPE. The method currently returns a nullable value so return type is the exact same. This change checks if the react instance manager is present and returns null early if not.

## Changelog:
[Android] [Fixed] - Adds a null check in react context getter

Differential Revision: D59982179
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Jul 19, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D59982179

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in aeb020d.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by Peter Abbondanzo in aeb020d

When will my fix make it into a release? | How to file a pick request?

@Abbondanzo Abbondanzo deleted the export-D59982179 branch July 20, 2024 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants