Skip to content

Commit caf80d4

Browse files
weih9facebook-github-bot
authored andcommitted
Fix crash from setProperty in RCTTurboModule
Summary: Changelog[Internal]: [iOS][Fixed] - Fix crash from calling setProperty in RCTTurboModule The crash is caused by passing a utf8 encoded string to a Object::setProperty overload which only allows ascii inputs. Reviewed By: RSNara Differential Revision: D43705999 fbshipit-source-id: b3f1b3fd27d43d40fe0a170d4c2e60faecc26dad
1 parent c72c592 commit caf80d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int32_t getUniqueId()
5959
{
6060
jsi::Object result = jsi::Object(runtime);
6161
for (NSString *k in value) {
62-
result.setProperty(runtime, [k UTF8String], convertObjCObjectToJSIValue(runtime, value[k]));
62+
result.setProperty(runtime, convertNSStringToJSIString(runtime, k), convertObjCObjectToJSIValue(runtime, value[k]));
6363
}
6464
return result;
6565
}

0 commit comments

Comments
 (0)