diff --git a/adapter/ohos/capability/udmf/udmf_impl.cpp b/adapter/ohos/capability/udmf/udmf_impl.cpp index 6e9fd749447..ccbb2813d9d 100644 --- a/adapter/ohos/capability/udmf/udmf_impl.cpp +++ b/adapter/ohos/capability/udmf/udmf_impl.cpp @@ -76,7 +76,9 @@ napi_value UdmfClientImpl::TransformUdmfUnifiedData(RefPtr& Unified CHECK_NULL_RETURN(engine, nullptr); NativeEngine* nativeEngine = engine->GetNativeEngine(); napi_env env = reinterpret_cast(nativeEngine); - auto unifiedData = AceType::DynamicCast(UnifiedData)->GetUnifiedData(); + auto unifiedDataImpl = AceType::DynamicCast(UnifiedData); + CHECK_NULL_RETURN(unifiedDataImpl, nullptr); + auto unifiedData = unifiedDataImpl->GetUnifiedData(); CHECK_NULL_RETURN(unifiedData, nullptr); napi_value dataVal = nullptr; UDMF::UnifiedDataNapi::NewInstance(env, unifiedData, dataVal); diff --git a/adapter/ohos/entrance/mmi_event_convertor.cpp b/adapter/ohos/entrance/mmi_event_convertor.cpp index e2ea49a9d3f..323c58dc712 100644 --- a/adapter/ohos/entrance/mmi_event_convertor.cpp +++ b/adapter/ohos/entrance/mmi_event_convertor.cpp @@ -151,6 +151,7 @@ void UpdateMouseEventForPen(const MMI::PointerEvent::PointerItem& pointerItem, M TouchEvent ConvertTouchEvent(const std::shared_ptr& pointerEvent) { + CHECK_NULL_RETURN(pointerEvent, TouchEvent()); int32_t pointerID = pointerEvent->GetPointerId(); MMI::PointerEvent::PointerItem item; bool ret = pointerEvent->GetPointerItem(pointerID, item); diff --git a/frameworks/bridge/common/dom/dom_grid_row.cpp b/frameworks/bridge/common/dom/dom_grid_row.cpp index c2dc16ccd2d..1e7df15d722 100644 --- a/frameworks/bridge/common/dom/dom_grid_row.cpp +++ b/frameworks/bridge/common/dom/dom_grid_row.cpp @@ -27,6 +27,7 @@ void DomGridRow::SetParentGridInfo(const RefPtr& parent) { if (columnType_ != GridColumnType::NONE) { auto info = GridSystemManager::GetInstance().GetInfoByType(columnType_); + CHECK_NULL_VOID(info); gridContainerInfo_ = info->GetParent(); boxComponent_->SetGridLayoutInfo(gridContainerInfo_); } else { diff --git a/frameworks/core/components_ng/event/focus_hub.cpp b/frameworks/core/components_ng/event/focus_hub.cpp index 14299a2c725..6605135d415 100644 --- a/frameworks/core/components_ng/event/focus_hub.cpp +++ b/frameworks/core/components_ng/event/focus_hub.cpp @@ -37,6 +37,8 @@ float GetMoveOffset(const RefPtr& parentFrameNode, const RefPtrGetGeometryNode(); CHECK_NULL_RETURN(parentGeometryNode, notMove); auto parentFrameSize = parentGeometryNode->GetFrameSize(); diff --git a/frameworks/core/components_ng/pattern/app_bar/atomic_service_pattern.cpp b/frameworks/core/components_ng/pattern/app_bar/atomic_service_pattern.cpp index 8170b6b07fd..9ee965a288c 100644 --- a/frameworks/core/components_ng/pattern/app_bar/atomic_service_pattern.cpp +++ b/frameworks/core/components_ng/pattern/app_bar/atomic_service_pattern.cpp @@ -357,7 +357,9 @@ void AtomicServicePattern::UpdateIconLayout(RefPtr& theme, RefPtrGetIconInsideMargin()); margin.right = CalcLength(theme->GetIconOutsideMargin()); } - icon->GetLayoutProperty()->UpdateMargin(margin); + auto layoutProperty = icon->GetLayoutProperty(); + CHECK_NULL_VOID(layoutProperty); + layoutProperty->UpdateMargin(margin); icon->MarkModifyDone(); icon->MarkDirtyNode(); diff --git a/frameworks/core/components_ng/pattern/stage/page_pattern.cpp b/frameworks/core/components_ng/pattern/stage/page_pattern.cpp index 0cc53046f54..f7ed4eb9866 100644 --- a/frameworks/core/components_ng/pattern/stage/page_pattern.cpp +++ b/frameworks/core/components_ng/pattern/stage/page_pattern.cpp @@ -468,7 +468,9 @@ bool PagePattern::AvoidKeyboard() const { auto pipeline = PipelineContext::GetCurrentContext(); CHECK_NULL_RETURN(pipeline, false); - return pipeline->GetSafeAreaManager()->KeyboardSafeAreaEnabled(); + auto safeAreaManager = pipeline->GetSafeAreaManager(); + CHECK_NULL_RETURN(safeAreaManager, false); + return safeAreaManager->KeyboardSafeAreaEnabled(); } bool PagePattern::RemoveOverlay()