From a1ef54fd3bf8c68ca1086253296eec8024c7497a Mon Sep 17 00:00:00 2001 From: Hilderin <81109165+Hilderin@users.noreply.github.com> Date: Tue, 16 Jul 2024 08:40:55 -0400 Subject: [PATCH] Fix removing a folder that contains a file is not removed from the FileSystem Dock --- editor/editor_file_system.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 4664defa59e1..ad42fba1c894 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];