mirror of
https://github.com/godotengine/godot.git
synced 2024-12-09 10:09:20 +08:00
Make Tree's set_selected check if treeitem belongs to the tree
This commit is contained in:
parent
64150060f8
commit
b79cac6d2d
@ -4544,6 +4544,8 @@ TreeItem *Tree::get_selected() const {
|
||||
void Tree::set_selected(TreeItem *p_item, int p_column) {
|
||||
ERR_FAIL_INDEX(p_column, columns.size());
|
||||
ERR_FAIL_NULL(p_item);
|
||||
ERR_FAIL_COND_MSG(p_item->get_tree() != this, "The provided TreeItem does not belong to this Tree. Ensure that the TreeItem is a part of the Tree before setting it as selected.");
|
||||
|
||||
select_single_item(p_item, get_root(), p_column);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user