mirror of
https://github.com/openharmony/ace_napi.git
synced 2026-07-21 16:55:22 -04:00
fix call napi function crash
Signed-off-by: zcdqs <junfeng.lijunfeng@huawei.com> Change-Id: I737fee9a2c58ec9579ef0f49e9c5180a8428b551
This commit is contained in:
@@ -401,6 +401,10 @@ NativeValue* ArkNativeEngine::CallFunction(NativeValue* thisVar,
|
||||
Global<FunctionRef> funcObj = *function;
|
||||
#ifdef ENABLE_CONTAINER_SCOPE
|
||||
auto nativeFunction = static_cast<NativeFunction*>(function->GetInterface(NativeFunction::INTERFACE_ID));
|
||||
if (nativeFunction == nullptr) {
|
||||
HILOG_ERROR("nativeFunction is null");
|
||||
return nullptr;
|
||||
}
|
||||
auto arkNativeFunc = static_cast<ArkNativeFunction*>(nativeFunction);
|
||||
OHOS::Ace::ContainerScope containerScope(arkNativeFunc->GetScopeId());
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user