You've already forked godot
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user