aboutsummaryrefslogtreecommitdiff
path: root/src/ui/UiHost.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-28 21:47:53 +0800
committercrupest <crupest@outlook.com>2020-06-28 21:47:53 +0800
commit26da84f59396075118ee769654471159e1f49980 (patch)
tree1f30fa3a167ea8de92bd22b907c82971515b0ab1 /src/ui/UiHost.cpp
parentb3c0c076e5a1b1e7d76fa8d32af0bcbb2c1cd4cf (diff)
downloadcru-26da84f59396075118ee769654471159e1f49980.tar.gz
cru-26da84f59396075118ee769654471159e1f49980.tar.bz2
cru-26da84f59396075118ee769654471159e1f49980.zip
...
Diffstat (limited to 'src/ui/UiHost.cpp')
-rw-r--r--src/ui/UiHost.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/UiHost.cpp b/src/ui/UiHost.cpp
index 09f8fd9b..56ce1eb9 100644
--- a/src/ui/UiHost.cpp
+++ b/src/ui/UiHost.cpp
@@ -365,6 +365,7 @@ void UiHost::UpdateCursor() {
}
Control* UiHost::HitTest(const Point& point) {
- return root_render_object_->HitTest(point)->GetAttachedControl();
+ const auto render_object = root_render_object_->HitTest(point);
+ return render_object ? render_object->GetAttachedControl() : nullptr;
}
} // namespace cru::ui