From 0db0a2c4213eb2d79c26ff16ff28c09fe44c0ce3 Mon Sep 17 00:00:00 2001 From: wwwcg Date: Thu, 17 Oct 2024 11:11:29 +0800 Subject: [PATCH] fix(ios): add nil protection when bridge released during loading bundle --- framework/ios/base/bridge/HippyBridge.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/ios/base/bridge/HippyBridge.mm b/framework/ios/base/bridge/HippyBridge.mm index 4f644c7c684..22e30951d91 100644 --- a/framework/ios/base/bridge/HippyBridge.mm +++ b/framework/ios/base/bridge/HippyBridge.mm @@ -558,6 +558,9 @@ - (void)beginLoadingBundle:(NSURL *)bundleURL dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [strongSelf fetchBundleWithURL:bundleURL completion:^(NSData *source, NSError *error) { __strong __typeof(weakSelf)strongSelf = weakSelf; + if (!strongSelf || !bundleURL) { + return; + } NSDictionary *userInfo; if (error) { HippyBridgeFatal(error, strongSelf);