Fixed !is_inside_tree() errors in file dialog

Fixed !is_inside_tree() errors appearing when current_file has a . in it.

(cherry picked from commit 2b13938459)
This commit is contained in:
DualMatrix 2018-08-18 16:04:58 +02:00 committed by Rémi Verschelde
parent 7586957720
commit 7624e1009a
1 changed files with 2 additions and 1 deletions

View File

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