diff options
-rw-r--r-- | scene/gui/file_dialog.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 25cb74a494..635f812805 100644 --- a/scene/gui/file_dialog.cpp +++ b/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) { |