diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 732cbb8e726..d335399caa9 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -339,6 +339,11 @@ void FileDialog::update_file_list() { } } + if (dirs.find("..")==NULL) { + //may happen if lacking permissions + dirs.push_back(".."); + } + dirs.sort_custom(); files.sort_custom(); diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index c80d7c88fb0..5afc4a71920 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -536,6 +536,11 @@ void EditorFileDialog::update_file_list() { } } + if (dirs.find("..")==NULL) { + //may happen if lacking permissions + dirs.push_back(".."); + } + dirs.sort_custom(); files.sort_custom();