From 4249f3ab616bdc38a92e4109ce761ba1ab16e471 Mon Sep 17 00:00:00 2001 From: wwwcg Date: Thu, 16 May 2024 15:25:27 +0800 Subject: [PATCH] fix(ios): null exception when converting JSI object to dictionary --- framework/ios/module/turbo/HippyOCTurboModule.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/ios/module/turbo/HippyOCTurboModule.mm b/framework/ios/module/turbo/HippyOCTurboModule.mm index 840f7282316..0741570dd92 100644 --- a/framework/ios/module/turbo/HippyOCTurboModule.mm +++ b/framework/ios/module/turbo/HippyOCTurboModule.mm @@ -315,7 +315,7 @@ static id convertJSIObjectToNSObject(const std::shared_ptr &co } std::u16string u16Key = StringViewUtils::ConvertEncoding(string_view, string_view::Encoding::Utf16).utf16_value(); NSString *stringKey = [NSString stringWithCharacters:(const unichar*)u16Key.c_str() length:(u16Key.length())]; - id objValue = convertCtxValueToObjcObject(context, value, module); + id objValue = convertCtxValueToObjcObject(context, value, module) ?: [NSNull null]; [result setObject:objValue forKey:stringKey]; } return [result copy];