aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls/SingleChildControl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/controls/SingleChildControl.h')
-rw-r--r--include/cru/ui/controls/SingleChildControl.h3
1 files changed, 2 insertions, 1 deletions
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 {