Skip to content

Commit 3c6e825

Browse files
Fix crash when dropping a panel to a new location in Godot 4.7
1 parent 6fb9853 commit 3c6e825

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

addons/dockable_container/dockable_container.gd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ func _can_drop_data(_position: Vector2, data) -> bool:
151151

152152
func _drop_data(_position: Vector2, data) -> void:
153153
var from_node := get_node(data.from_path)
154-
if from_node is TabBar:
154+
while from_node is not TabContainer and is_instance_valid(from_node):
155155
from_node = from_node.get_parent()
156+
if not is_instance_valid(from_node):
157+
return
156158
if from_node == _drag_panel and _drag_panel.get_child_count() == 1:
157159
return
158160
var tab_index = data.tabc_element if data.has("tabc_element") else data.tab_index

0 commit comments

Comments
 (0)