diff options
author | m3g4d1v3r <marlon365x@protonmail.ch> | 2022-05-26 23:56:52 -0300 |
---|---|---|
committer | m3g4d1v3r <marlon365x@protonmail.ch> | 2022-05-26 23:56:52 -0300 |
commit | ee89c65b11462853c6b963959ee76e4941427eb7 (patch) | |
tree | 520b9f2dc7168e7acdfc200895abe52310c1005e | |
parent | 9d28e1027636ebf1750a65105f6a23a17210813d (diff) |
Add nullptr handling of argument pointer in Tree::scroll_to_item
-rw-r--r-- | scene/gui/tree.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 8f292533e6..bafa83392b 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -4523,6 +4523,7 @@ Point2 Tree::get_scroll() const { } 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()) { return; // Hack to work around crash in get_item_rect() if Tree is not in tree. } |