From 47a4ca0022fe961d7dc607f37b0af6b5d0283d2e Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Tue, 12 Nov 2019 08:15:29 +0100 Subject: Fixed crash when pressing down key on empty Tree Fixes #33554 --- scene/gui/tree.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scene') diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index a44b42a467..d479a1636a 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2224,8 +2224,9 @@ void Tree::_go_down() { TreeItem *next = NULL; if (!selected_item) { - next = hide_root ? root->get_next_visible() : root; - selected_item = 0; + if (root) { + next = hide_root ? root->get_next_visible() : root; + } } else { next = selected_item->get_next_visible(); -- cgit v1.2.3