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

Fix runOnMainThread to run at front of queue #7792

Merged
merged 1 commit into from
Oct 5, 2023
Merged

Conversation

yogevbd
Copy link
Collaborator

@yogevbd yogevbd commented Oct 5, 2023

This fixes a crash happening in the Wix app, look like there's a race condition where the activity is destroyed and navigator.onHostPause() gets called too late and should always be called at front of queue. Most of times this shouldn't be delayed as it is called on the main thread.

This is the crash:

Location
NavigationModule.java line 213 in com.reactnativenavigation.react.NavigationModule.navigator
Exception
java.lang.NullPointerException
Message
Attempt to invoke virtual method 'com.reactnativenavigation.viewcontrollers.navigator.Navigator com.reactnativenavigation.NavigationActivity.getNavigator()' on a null object reference

Closes #7769

@thuongtv-vn
Copy link

Hi @yogevbd
I am facing the same error message:
Attempt to invoke virtual method 'com.reactnativenavigation.viewcontrollers.navigator.Navigator com.reactnativenavigation.NavigationActivity.getNavigator()' on a null object reference

As your mentioned, the activity is destroyed so mean the error message appears in case we close the app, isn't it?

svetlanasapelova added a commit to SowaLabs/react-native-navigation that referenced this pull request Oct 10, 2023
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.

Fatal Exception: java.lang.NullPointerException
2 participants