diff options
author | Tomasz Chabora <kobewi4e@gmail.com> | 2019-06-04 01:50:50 +0200 |
---|---|---|
committer | Tomasz Chabora <kobewi4e@gmail.com> | 2019-06-04 01:50:50 +0200 |
commit | 2f75471f245229fb3789d26f4c978300bd1efd10 (patch) | |
tree | 2016aebe25be49f65ae1823c34e3ef4040cff65f /scene/gui | |
parent | 774a9fde84a0282c40da1dd891b613ed200ff9a8 (diff) |
Fix crash when searching Tree with no selection
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/tree.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 474eb51860..2007ae2669 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3532,14 +3532,14 @@ TreeItem *Tree::_search_item_text(TreeItem *p_at, const String &p_find, int *r_c TreeItem *Tree::search_item_text(const String &p_find, int *r_col, bool p_selectable) { - TreeItem *from = get_selected()->get_next_visible(); + TreeItem *from = get_selected(); - if (!root) + if (!from) from = root; if (!from) return NULL; - return _search_item_text(from, p_find, r_col, p_selectable); + return _search_item_text(from->get_next_visible(true), p_find, r_col, p_selectable); } void Tree::_do_incr_search(const String &p_add) { |