wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.01k stars 2.68k forks source link

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

Open moonjava2005 opened 8 months ago

moonjava2005 commented 8 months ago

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

yogevbd commented 8 months ago

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

moonjava2005 commented 8 months ago

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 https://github.com/wix/react-native-navigation/pull/7799

MatthewPattell commented 8 months ago

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

moonjava2005 commented 7 months ago

@yogevbd Could your review this PR?

stale[bot] commented 4 months ago

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.