You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 19:41:11 +00:00
Fix negative indices in TreeItem
This commit is contained in:
@@ -723,7 +723,12 @@ TreeItem *TreeItem::get_next_visible(bool p_wrap) {
|
||||
|
||||
TreeItem *TreeItem::get_child(int p_idx) {
|
||||
_create_children_cache();
|
||||
|
||||
if (p_idx < 0) {
|
||||
p_idx += children_cache.size();
|
||||
}
|
||||
ERR_FAIL_INDEX_V(p_idx, children_cache.size(), nullptr);
|
||||
|
||||
return children_cache.get(p_idx);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user