diff options
Diffstat (limited to 'editor/editor_file_dialog.cpp')
-rw-r--r-- | editor/editor_file_dialog.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index bea5c99c1a..ec8651ac7c 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -761,10 +761,11 @@ void EditorFileDialog::update_file_list() { List<String> files; List<String> dirs; - String item; + String item = dir_access->get_next(); - while ((item = dir_access->get_next()) != "") { + while (!item.is_empty()) { if (item == "." || item == "..") { + item = dir_access->get_next(); continue; } @@ -775,6 +776,7 @@ void EditorFileDialog::update_file_list() { dirs.push_back(item); } } + item = dir_access->get_next(); } dirs.sort_custom<NaturalNoCaseComparator>(); |