aboutsummaryrefslogtreecommitdiff
path: root/src/ui/control.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/control.cpp')
-rw-r--r--src/ui/control.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/control.cpp b/src/ui/control.cpp
index 7691dac2..5417f4ce 100644
--- a/src/ui/control.cpp
+++ b/src/ui/control.cpp
@@ -33,12 +33,12 @@ void Control::_SetParent(Control* parent) {
}
void Control::_SetDescendantUiHost(UiHost* host) {
+ if (host == nullptr && ui_host_ == nullptr) return;
+
// You can only attach or detach window.
Expects((host != nullptr && ui_host_ == nullptr) ||
(host == nullptr && ui_host_ != nullptr));
- if (host == nullptr && ui_host_ == nullptr) return;
-
if (host == nullptr) {
const auto old = ui_host_;
TraverseDescendants([old](Control* control) {