summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafał Mikrut <mikrutrafal@protonmail.com>2021-01-12 10:48:18 +0100
committerRafał Mikrut <mikrutrafal@protonmail.com>2021-01-12 10:48:18 +0100
commit56734f44e58b8c94b04c0d90ddb931a01a30f75d (patch)
tree214fd94bb223c457d5327027329c2002c71030e2
parent8e514bbf6ab3d2cff4daeb64e842bd8846c07046 (diff)
Fix errors when removing non Control node from TabContainer
-rw-r--r--scene/gui/tab_container.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp
index 7f0d7b6e7b..64a2a1843d 100644
--- a/scene/gui/tab_container.cpp
+++ b/scene/gui/tab_container.cpp
@@ -789,6 +789,10 @@ Control *TabContainer::get_current_tab_control() const {
void TabContainer::remove_child_notify(Node *p_child) {
Container::remove_child_notify(p_child);
+ if (!Object::cast_to<Control>(p_child)) {
+ return;
+ }
+
call_deferred("_update_current_tab");
p_child->disconnect("renamed", callable_mp(this, &TabContainer::_child_renamed_callback));