File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/react-native/ReactAndroid/src/main/java/com/facebook/react Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -149,8 +149,10 @@ public void onHostDestroy() {
149149 if (ReactNativeFeatureFlags .enableBridgelessArchitecture ()) {
150150 mReactHost .onHostDestroy (mActivity );
151151 } else {
152- if (getReactNativeHost ().hasInstance ()) {
153- getReactNativeHost ().getReactInstanceManager ().onHostDestroy (mActivity );
152+ if (getReactNativeHost () != null ) {
153+ if (getReactNativeHost ().hasInstance () && getReactNativeHost ().getReactInstanceManager () != null ) {
154+ getReactNativeHost ().getReactInstanceManager ().onHostDestroy (mActivity );
155+ }
154156 }
155157 }
156158 }
@@ -311,9 +313,9 @@ public void unloadApp() {
311313 mReactSurface = null ;
312314 }
313315 } else {
314- if (mReactRootView != null ) {
315- mReactRootView .unmountReactApplication ();
316- mReactRootView = null ;
316+ if (this . mReactRootView != null ) {
317+ this . mReactRootView .unmountReactApplication ();
318+ this . mReactRootView = null ;
317319 }
318320 }
319321 }
You can’t perform that action at this time.
0 commit comments