summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2019-11-12 08:15:29 +0100
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2019-11-12 08:15:29 +0100
commit47a4ca0022fe961d7dc607f37b0af6b5d0283d2e (patch)
treef18840173712c1e830afdac637f3b7a061b95862 /scene
parent5f4ab5c77ded1c078c8e3543727d576d837942e0 (diff)
Fixed crash when pressing down key on empty Tree
Fixes #33554
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/tree.cpp5
1 files changed, 3 insertions, 2 deletions
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();