Skip to content

Commit 2d3a4fb

Browse files
authored
Fix onHostPause crash on Android (#7812)
* Fix onHostPause crash on Android * Update NavigationModule.java
1 parent d2668c5 commit 2d3a4fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public NavigationModule(ReactApplicationContext reactContext, ReactInstanceManag
5959
@Override
6060
public void onHostPause() {
6161
super.onHostPause();
62-
UiUtils.runOnMainThread(() -> navigator().onHostPause());
62+
UiUtils.runOnMainThread(() -> {
63+
if (activity() != null) navigator().onHostPause();
64+
});
6365
}
6466

6567
@Override

0 commit comments

Comments
 (0)