From 8f19d50e275738333d3c8af8dde5fa51cd0fc76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Tue, 12 Jan 2021 10:48:18 +0100 Subject: [PATCH] Fix errors when removing non Control node from TabContainer (cherry picked from commit 56734f44e58b8c94b04c0d90ddb931a01a30f75d) --- scene/gui/tab_container.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 61565e1bfe1..673641c0446 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -648,6 +648,10 @@ void TabContainer::remove_child_notify(Node *p_child) { Container::remove_child_notify(p_child); + if (!Object::cast_to(p_child)) { + return; + } + call_deferred("_update_current_tab"); p_child->disconnect("renamed", this, "_child_renamed_callback");