Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): turbo module type convert nullptr crash #3958

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions core/src/napi/jsc/jsc_ctx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,6 @@ std::shared_ptr<CtxValue> JSCCtx::CreateObject(const std::unordered_map<std::sha
std::shared_ptr<CtxValue> JSCCtx::CreateArray(
size_t count,
std::shared_ptr<CtxValue> array[]) {
if (count <= 0) {
return nullptr;
}

JSValueRef values[count]; // NOLINT(runtime/arrays)
for (size_t i = 0; i < count; i++) {
Expand Down
2 changes: 1 addition & 1 deletion ios/sdk/module/turbo/HippyOCTurboModule.mm
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ - (id)invokeObjCMethodWithName:(NSString *)methodName
std::shared_ptr<napi::CtxValue> propRef = convertObjcObjectToCtxValue(jscCtx, propValue, module);
std::shared_ptr<JSCCtxValue> ctx_value =
std::static_pointer_cast<JSCCtxValue>(propRef);
JSValueRef valueRef = ctx_value->value_;
JSValueRef valueRef = ctx_value ? ctx_value->value_ : nullptr;

JSStringRef propName = JSStringCreateWithCFString((__bridge CFStringRef)propertyName);
JSValueRef jsError = NULL;
Expand Down
Loading