diff --git a/frameworks/core/components_ng/pattern/overlay/sheet_view.cpp b/frameworks/core/components_ng/pattern/overlay/sheet_view.cpp index f1a1cb4f7b6..ed3dc3a1855 100644 --- a/frameworks/core/components_ng/pattern/overlay/sheet_view.cpp +++ b/frameworks/core/components_ng/pattern/overlay/sheet_view.cpp @@ -310,6 +310,7 @@ RefPtr SheetView::BuildMainTitle(RefPtr sheetNode, NG::She RefPtr SheetView::BuildSubTitle(RefPtr sheetNode, NG::SheetStyle& sheetStyle) { + CHECK_NULL_RETURN(sheetNode, nullptr); auto pattern = sheetNode->GetPattern(); CHECK_NULL_RETURN(pattern, nullptr); auto subtitleId = pattern->GetSubtitleId(); diff --git a/frameworks/core/components_v2/inspector/stepper_composed_element.cpp b/frameworks/core/components_v2/inspector/stepper_composed_element.cpp index f7515dbda4c..647d24dd521 100644 --- a/frameworks/core/components_v2/inspector/stepper_composed_element.cpp +++ b/frameworks/core/components_v2/inspector/stepper_composed_element.cpp @@ -65,6 +65,7 @@ RefPtr StepperComposedElement::GetStepperComponent() const void StepperComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr& newComponent) { auto stepperComponent = GetStepperComponent(); + CHECK_NULL_VOID(stepperComponent); stepperComponent->InsertChild(slot, newComponent); auto renderStepper = GetInspectorElement(StepperElement::TypeId()); if (!renderStepper) {