Skip to content

Commit

Permalink
fix(ios): avoid startup crash when script load error
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Sep 13, 2024
1 parent 62d777e commit 7197030
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion framework/ios/base/bridge/HippyBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ - (void)beginLoadingBundle:(NSURL *)bundleURL
if (!strongSelf || !strongSelf.valid || !script) {
NSString *errMsg = [NSString stringWithFormat:@"Bundle Execution Operation Fail! valid:%d, script:%@",
strongSelf.valid, script];
completion(nil, HippyErrorWithMessage(errMsg));
HippyLogError(@"%@", errMsg);
completion(bundleURL, HippyErrorWithMessage(errMsg));
strongSelf.lastExecuteOperation = nil;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion renderer/native/ios/renderer/HippyRootView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ - (instancetype)initWithBridge:(HippyBridge *)bridge
}

// 抛出业务包(BusinessBundle aka SecondaryBundle)加载完成通知,for hippy2兼容
NSMutableDictionary *userInfo = @{ kHippyNotiBundleUrlKey: url,
NSMutableDictionary *userInfo = @{ kHippyNotiBundleUrlKey: url ?: @"",
kHippyNotiBridgeKey: strongSelf.bridge }.mutableCopy;
if (error) { [userInfo setObject:error forKey:kHippyNotiErrorKey]; }
HIPPY_IGNORE_WARNING_BEGIN(-Wdeprecated)
Expand Down

0 comments on commit 7197030

Please sign in to comment.