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
This commit is contained in:
Wei Han authored and Facebook GitHub Bot committed 2023-03-02 10:31:21 -08:00
1 parent c72c592ecd
commit caf80d442b
1 file changed
+1 -1
@@ -59,7 +59,7 @@ static jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDicti
{
jsi::Object result = jsi::Object(runtime);
for (NSString *k in value) {
result.setProperty(runtime, [k UTF8String], convertObjCObjectToJSIValue(runtime, value[k]));
result.setProperty(runtime, convertNSStringToJSIString(runtime, k), convertObjCObjectToJSIValue(runtime, value[k]));
}
return result;
}