mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add logging in ReactInstanceManager.onHostPause when activity is incorrectly null (#48226)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48226 Adding logging to onHostPause to help diagnose cases when the activity is incorrectly null. Reviewed By: fkgozali Differential Revision: D67123351 fbshipit-source-id: f694a3a89e4584776050f6bca2f33f2805528d4b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
81c74cd35f
commit
c2fd35a442
+10
@@ -651,6 +651,16 @@ public class ReactInstanceManager {
|
||||
@ThreadConfined(UI)
|
||||
public void onHostPause(@Nullable Activity activity) {
|
||||
if (mRequireActivity) {
|
||||
if (mCurrentActivity == null) {
|
||||
String message =
|
||||
"ReactInstanceManager.onHostPause called with null activity, expected:"
|
||||
+ mCurrentActivity.getClass().getSimpleName();
|
||||
FLog.e(TAG, message);
|
||||
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
|
||||
for (StackTraceElement element : stackTrace) {
|
||||
FLog.e(TAG, element.toString());
|
||||
}
|
||||
}
|
||||
Assertions.assertCondition(mCurrentActivity != null);
|
||||
}
|
||||
if (mCurrentActivity != null) {
|
||||
|
||||
Reference in New Issue
Block a user