소스 검색

Merge pull request #21152 from DualMatrix/fileselect_error

Fixed !is_inside_tree() errors in file dialog
Rémi Verschelde 7 년 전
부모
커밋
8b25c0513f
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      scene/gui/file_dialog.cpp

+ 2 - 1
scene/gui/file_dialog.cpp

@@ -582,7 +582,8 @@ void FileDialog::set_current_file(const String &p_file) {
 	int lp = p_file.find_last(".");
 	if (lp != -1) {
 		file->select(0, lp);
-		file->grab_focus();
+		if (file->is_inside_tree())
+			file->grab_focus();
 	}
 }
 void FileDialog::set_current_path(const String &p_path) {