summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-07-17 11:44:42 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-07-17 11:44:42 +0200
commitee9f20b45742afc8731070343ae43e11c7c6e50f (patch)
tree67464fda666729892bef948b1d911da057e59b33
parent68277795875b33059a7623713ddee5ff8f35b06a (diff)
parenta1ef54fd3bf8c68ca1086253296eec8024c7497a (diff)
downloadredot-engine-ee9f20b45742afc8731070343ae43e11c7c6e50f.tar.gz
Merge pull request #94435 from Hilderin/fix-removing-folder-with-files
Fix removing a folder that contains a file is not removed from the FileSystem Dock
-rw-r--r--editor/editor_file_system.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 4664defa59..ad42fba1c8 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -1594,7 +1594,10 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector
}
if (idx == -1) {
- //does not exist, create i guess?
+ // Only create a missing directory in memory when it exists on disk.
+ if (!dir->dir_exists(fs->get_path().path_join(path[i]))) {
+ return false;
+ }
EditorFileSystemDirectory *efsd = memnew(EditorFileSystemDirectory);
efsd->name = path[i];