nullptr check

Signed-off-by: chensiyi_CE <chensiyi12@huawei.com>
This commit is contained in:
chensiyi_CE 2024-11-18 22:12:25 +08:00
parent f6e00539bf
commit ecb04a16d1
2 changed files with 3 additions and 3 deletions

View File

@ -21,9 +21,9 @@
namespace OHOS::Ace::Framework {
void RemoteWindowModelImpl::Create(const std::shared_ptr<OHOS::Rosen::RSNode>& rsNode)
{
auto* specializedComponent = AceType::MakeRefPtr<OHOS::Ace::RemoteWindowComponent>();
auto specializedComponent = AceType::MakeRefPtr<OHOS::Ace::RemoteWindowComponent>();
CHECK_NULL_VOID(specializedComponent);
auto stack = ViewStackProcessor::GetInstance();
auto* stack = ViewStackProcessor::GetInstance();
CHECK_NULL_VOID(stack);
stack->Push(specializedComponent);
specializedComponent->SetExternalRSNode(rsNode);

View File

@ -27,9 +27,9 @@ void RemoteWindowModelNG::Create(const std::shared_ptr<OHOS::Rosen::RSNode>& rsN
ACE_LAYOUT_SCOPED_TRACE("Create[%s][self:%d]", V2::REMOTE_WINDOW_ETS_TAG, nodeId);
auto frameNode = FrameNode::GetOrCreateFrameNode(
V2::REMOTE_WINDOW_ETS_TAG, nodeId, []() { return AceType::MakeRefPtr<RemoteWindowPattern>(); });
CHECK_NULL_VOID(frameNode);
stack->Push(frameNode);
#ifdef ENABLE_ROSEN_BACKEND
CHECK_NULL_VOID(frameNode);
auto context = AceType::DynamicCast<NG::RosenRenderContext>(frameNode->GetRenderContext());
CHECK_NULL_VOID(context);
context->SetRSNode(rsNode);