1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Defend against directories without trailing slashes

This commit is contained in:
Mike Precup
2025-03-12 05:22:01 -07:00
parent 0a30831bed
commit 9de4efa451
2 changed files with 8 additions and 2 deletions

View File

@@ -3437,7 +3437,7 @@ Error EditorFileSystem::make_dir_recursive(const String &p_path, const String &p
ERR_FAIL_NULL_V(parent, ERR_FILE_NOT_FOUND);
folders_to_sort.insert(parent->get_instance_id());
const PackedStringArray folders = p_path.trim_prefix(path).trim_suffix("/").split("/");
const PackedStringArray folders = p_path.trim_prefix(path).split("/", false);
for (const String &folder : folders) {
const int current = parent->find_dir_index(folder);
if (current > -1) {