declarative_frontend.cpp jsEngine_空指针

Signed-off-by: Lby <liboyu12@huawei.com>
This commit is contained in:
Lby 2024-09-23 14:45:02 +08:00
parent 9328766a6c
commit 4e3fc0f547

View File

@ -838,12 +838,18 @@ void DeclarativeFrontend::TransferJsResponseData(int callbackId, int32_t code, s
napi_value DeclarativeFrontend::GetContextValue()
{
return jsEngine_->GetContextValue();
if (jsEngine_) {
return jsEngine_->GetContextValue();
}
return nullptr;
}
napi_value DeclarativeFrontend::GetFrameNodeValueByNodeId(int32_t nodeId)
{
return jsEngine_->GetFrameNodeValueByNodeId(nodeId);
if (jsEngine_) {
return jsEngine_->GetFrameNodeValueByNodeId(nodeId);
}
return nullptr;
}
#if defined(PREVIEW)