From 9307bd1af7c52aaf9c6d25b598bf3069a63c32a1 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 16 Feb 2022 23:04:27 +0800 Subject: ... --- include/cru/ui/controls/SingleChildControl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/cru/ui/controls/SingleChildControl.h') diff --git a/include/cru/ui/controls/SingleChildControl.h b/include/cru/ui/controls/SingleChildControl.h index 6bf150c0..e733c825 100644 --- a/include/cru/ui/controls/SingleChildControl.h +++ b/include/cru/ui/controls/SingleChildControl.h @@ -31,7 +31,8 @@ class SingleChildControl : public Control { child->SetParent(this); } - container_render_object_->SetChild(child->GetRenderObject()); + container_render_object_->SetChild( + child == nullptr ? nullptr : child->GetRenderObject()); } render::RenderObject* GetRenderObject() const override { -- cgit v1.2.3