Ver código fonte

Fixed crash when pressing down key on empty Tree

Fixes #33554

(cherry picked from commit 47a4ca0022fe961d7dc607f37b0af6b5d0283d2e)
PouleyKetchoupp 5 anos atrás
pai
commit
9360b23544
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      scene/gui/tree.cpp

+ 3 - 2
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();