summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDualMatrix <piet.goris@gmail.com>2018-08-18 16:04:58 +0200
committerDualMatrix <piet.goris@gmail.com>2018-08-18 16:52:15 +0200
commit2b139384591afa69b209367bd93a4041aa4c97e0 (patch)
tree3910e5b47c3a18db10acccb25898b83464dc4f23
parentc93888ae71bcc2b633f335b407c75412a493012d (diff)
Fixed !is_inside_tree() errors in file dialog
Fixed !is_inside_tree() errors appearing when current_file has a . in it.
-rw-r--r--scene/gui/file_dialog.cpp3
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) {