Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] fix: Check null in order to avoid crash randomly and unexpectedly #7810

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moonjava2005
Copy link

From our app crashlytic, we saw a lot of crashes like this
Attempt to invoke virtual method 'com.reactnativenavigation.viewcontrollers.navigator.Navigator com.reactnativenavigation.NavigationActivity.getNavigator()' on a null object reference
I cannot figure out why navigator is NULL. However, we should check null before calling method in order to avoid unexpected crash. I think the React host is null in moment, and then when users click again, the host will be available

@moonjava2005 moonjava2005 changed the title fix: Check null in order to avoid crash randomly and unexpectedly [android] fix: Check null in order to avoid crash randomly and unexpectedly Nov 9, 2023
@moonjava2005 moonjava2005 changed the title [android] fix: Check null in order to avoid crash randomly and unexpectedly [Android] fix: Check null in order to avoid crash randomly and unexpectedly Nov 9, 2023
@yogevbd
Copy link
Collaborator

yogevbd commented Nov 9, 2023

Does this crash reproduce with the latest RNN version? because it should be fixed in this PR

@moonjava2005
Copy link
Author

moonjava2005 commented Nov 9, 2023

Does this crash reproduce with the latest RNN version? because it should be fixed in this PR

I got these crashes with RNN 7.37.1 And the PR you have just attached to your reply is this PR :D
I have another PR for fixing crash on bottom tabs but no one review for me too #7799

@MatthewPattell
Copy link

I can confirm the same, on the latest version of the package.

@moonjava2005 moonjava2005 force-pushed the fix-null-navigator-randomly-on-android branch from a720283 to 871a0f4 Compare December 12, 2023 08:35
@moonjava2005
Copy link
Author

@yogevbd Could your review this PR?

Copy link

stale bot commented Mar 17, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants