Add nullptr handling of argument pointer in Tree::scroll_to_item
This commit is contained in:
parent
9d28e10276
commit
ee89c65b11
@ -4523,6 +4523,7 @@ Point2 Tree::get_scroll() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Tree::scroll_to_item(TreeItem *p_item, bool p_center_on_item) {
|
void Tree::scroll_to_item(TreeItem *p_item, bool p_center_on_item) {
|
||||||
|
ERR_FAIL_NULL(p_item);
|
||||||
if (!is_visible_in_tree() || !p_item->is_visible()) {
|
if (!is_visible_in_tree() || !p_item->is_visible()) {
|
||||||
return; // Hack to work around crash in get_item_rect() if Tree is not in tree.
|
return; // Hack to work around crash in get_item_rect() if Tree is not in tree.
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user