From 9360b2354486fe5ae75dd3860cf71dd55df7c63c Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Tue, 12 Nov 2019 08:15:29 +0100 Subject: [PATCH] Fixed crash when pressing down key on empty Tree Fixes #33554 (cherry picked from commit 47a4ca0022fe961d7dc607f37b0af6b5d0283d2e) --- scene/gui/tree.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index b10e16afc62..59e218de6f3 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2152,8 +2152,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();