!36042 修复ContentSlot新增\删除\插入空节点闪退问题

Merge pull request !36042 from lanshouren/work_0619
This commit is contained in:
openharmony_ci 2024-06-20 10:31:05 +00:00 committed by Gitee
commit 5ee551ca0c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -672,6 +672,7 @@ int32_t OH_ArkUI_NodeContent_AddNode(ArkUI_NodeContentHandle content, ArkUI_Node
{
auto* impl = OHOS::Ace::NodeModel::GetFullImpl();
CHECK_NULL_RETURN(impl, OHOS::Ace::ERROR_CODE_NATIVE_IMPL_LIBRARY_NOT_FOUND);
CHECK_NULL_RETURN(node, OHOS::Ace::ERROR_CODE_PARAM_INVALID);
return impl->getNodeModifiers()->getNodeContentModifier()->addChild(
reinterpret_cast<ArkUINodeContentHandle>(content), node->uiNodeHandle);
}
@ -680,6 +681,7 @@ int32_t OH_ArkUI_NodeContent_InsertNode(ArkUI_NodeContentHandle content, ArkUI_N
{
auto* impl = OHOS::Ace::NodeModel::GetFullImpl();
CHECK_NULL_RETURN(impl, OHOS::Ace::ERROR_CODE_NATIVE_IMPL_LIBRARY_NOT_FOUND);
CHECK_NULL_RETURN(node, OHOS::Ace::ERROR_CODE_PARAM_INVALID);
return impl->getNodeModifiers()->getNodeContentModifier()->insertChild(
reinterpret_cast<ArkUINodeContentHandle>(content), node->uiNodeHandle, position);
}
@ -688,6 +690,7 @@ int32_t OH_ArkUI_NodeContent_RemoveNode(ArkUI_NodeContentHandle content, ArkUI_N
{
auto* impl = OHOS::Ace::NodeModel::GetFullImpl();
CHECK_NULL_RETURN(impl, OHOS::Ace::ERROR_CODE_NATIVE_IMPL_LIBRARY_NOT_FOUND);
CHECK_NULL_RETURN(node, OHOS::Ace::ERROR_CODE_PARAM_INVALID);
return impl->getNodeModifiers()->getNodeContentModifier()->removeChild(
reinterpret_cast<ArkUINodeContentHandle>(content), node->uiNodeHandle);
}