react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

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

Open moonjava2005 opened this issue 2 years ago • 5 comments

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 avatar Nov 09 '23 11:11 moonjava2005

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

yogevbd avatar Nov 09 '23 12:11 yogevbd

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

moonjava2005 avatar Nov 09 '23 13:11 moonjava2005

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

MatthewPattell avatar Nov 10 '23 13:11 MatthewPattell

@yogevbd Could your review this PR?

moonjava2005 avatar Dec 12 '23 08:12 moonjava2005

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[bot] avatar Mar 17 '24 08:03 stale[bot]