Catch ClassCastException activity (#4323)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
This commit is contained in:
parent
679a897848
commit
9506875683
1 changed files with 16 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java
|
||||
index 260ed81..52b53d8 100644
|
||||
index 260ed81..f719679 100644
|
||||
--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java
|
||||
+++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java
|
||||
@@ -56,14 +56,18 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
||||
|
|
@ -29,6 +29,21 @@ index 260ed81..52b53d8 100644
|
|||
}
|
||||
});
|
||||
}
|
||||
@@ -196,8 +200,12 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
||||
|
||||
protected void handle(Runnable task) {
|
||||
UiThread.post(() -> {
|
||||
- if (getCurrentActivity() != null && !activity().isFinishing()) {
|
||||
- task.run();
|
||||
+ try {
|
||||
+ if (getCurrentActivity() != null && !activity().isFinishing()) {
|
||||
+ task.run();
|
||||
+ }
|
||||
+ } catch (ClassCastException e) {
|
||||
+ // The most current activity is not a NavigationActivity
|
||||
}
|
||||
});
|
||||
}
|
||||
diff --git a/node_modules/react-native-navigation/lib/ios/RNNCommandsHandler.m b/node_modules/react-native-navigation/lib/ios/RNNCommandsHandler.m
|
||||
index ae8be52..8a8dec5 100644
|
||||
--- a/node_modules/react-native-navigation/lib/ios/RNNCommandsHandler.m
|
||||
|
|
|
|||
Loading…
Reference in a new issue