소스 검색

Fixed crash when pressing down key on empty Tree

Fixes #33554
PouleyKetchoupp 5 년 전
부모
커밋
47a4ca0022
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      scene/gui/tree.cpp

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