2
0
Эх сурвалжийг харах

Fix errors when removing non Control node from TabContainer

(cherry picked from commit 56734f44e58b8c94b04c0d90ddb931a01a30f75d)
Rafał Mikrut 4 жил өмнө
parent
commit
8f19d50e27

+ 4 - 0
scene/gui/tab_container.cpp

@@ -648,6 +648,10 @@ void TabContainer::remove_child_notify(Node *p_child) {
 
 
 	Container::remove_child_notify(p_child);
 	Container::remove_child_notify(p_child);
 
 
+	if (!Object::cast_to<Control>(p_child)) {
+		return;
+	}
+
 	call_deferred("_update_current_tab");
 	call_deferred("_update_current_tab");
 
 
 	p_child->disconnect("renamed", this, "_child_renamed_callback");
 	p_child->disconnect("renamed", this, "_child_renamed_callback");