From 7acc91d68df42672ed3e47b3373370609c3635ff Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 13 Nov 2023 15:54:36 +0200 Subject: [PATCH] Fix onHostPause crash on Android --- .../com/reactnativenavigation/react/NavigationModule.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java b/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java index a34598c6651..195973f4025 100644 --- a/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java +++ b/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java @@ -59,7 +59,9 @@ public NavigationModule(ReactApplicationContext reactContext, ReactInstanceManag @Override public void onHostPause() { super.onHostPause(); - UiUtils.runOnMainThread(() -> navigator().onHostPause()); + UiUtils.runOnMainThread(() -> { + if (navigator() != null) navigator().onHostPause(); + }); } @Override