From 2b139384591afa69b209367bd93a4041aa4c97e0 Mon Sep 17 00:00:00 2001 From: DualMatrix Date: Sat, 18 Aug 2018 16:04:58 +0200 Subject: [PATCH] Fixed !is_inside_tree() errors in file dialog Fixed !is_inside_tree() errors appearing when current_file has a . in it. --- scene/gui/file_dialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 25cb74a494f..635f8128053 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) {