1
0
Fork 0

Fix potential crash on failed move.

This commit is contained in:
Jordyfel 2023-10-25 14:52:34 +03:00
parent 06d5189167
commit 85144f0cd1
1 changed files with 3 additions and 1 deletions

View File

@ -1554,8 +1554,10 @@ void FileSystemDock::_try_duplicate_item(const FileOrFolder &p_item, const Strin
void FileSystemDock::_update_resource_paths_after_move(const HashMap<String, String> &p_renames, const HashMap<String, ResourceUID::ID> &p_uids) const { void FileSystemDock::_update_resource_paths_after_move(const HashMap<String, String> &p_renames, const HashMap<String, ResourceUID::ID> &p_uids) const {
// Update the paths in ResourceUID, so that UIDs remain valid. // Update the paths in ResourceUID, so that UIDs remain valid.
for (const KeyValue<String, ResourceUID::ID> &pair : p_uids) { for (const KeyValue<String, ResourceUID::ID> &pair : p_uids) {
if (p_renames.has(pair.key)) {
ResourceUID::get_singleton()->set_id(pair.value, p_renames[pair.key]); ResourceUID::get_singleton()->set_id(pair.value, p_renames[pair.key]);
} }
}
// Rename all resources loaded, be it subresources or actual resources. // Rename all resources loaded, be it subresources or actual resources.
List<Ref<Resource>> cached; List<Ref<Resource>> cached;