diff --git a/framework/ios/base/bridge/HippyBridge.mm b/framework/ios/base/bridge/HippyBridge.mm index d9808e816d1..78fdf1948bd 100644 --- a/framework/ios/base/bridge/HippyBridge.mm +++ b/framework/ios/base/bridge/HippyBridge.mm @@ -680,8 +680,9 @@ - (void)unloadInstanceForRootView:(NSNumber *)rootTag { NSDictionary *param = @{@"id": rootTag}; footstone::value::HippyValue value = [param toHippyValue]; std::shared_ptr domValue = std::make_shared(value); - self.javaScriptExecutor.pScope->UnloadInstance(domValue); - + if (self.javaScriptExecutor) { + self.javaScriptExecutor.pScope->UnloadInstance(domValue); + } _renderManager->UnregisterRootView([rootTag intValue]); if (_rootNode) { _rootNode->ReleaseResources(); @@ -1118,7 +1119,6 @@ - (void)invalidate { id jsExecutor = _javaScriptExecutor; id moduleSetup = _moduleSetup; _displayLink = nil; - _javaScriptExecutor = nil; _moduleSetup = nil; _startTime = footstone::TimePoint::SystemNow(); self.moduleSemaphore = nil;