summaryrefslogtreecommitdiffstats
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-10-26 08:59:10 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-10-26 08:59:10 +0200
commit27679dbfa4ee5a4f0356a83484fc4698226b0de4 (patch)
tree7c88fce23d530032d0df36c528e58b454dc4b251 /editor/filesystem_dock.cpp
parent1b3e00dc2921bc8f74b66f9636e0c19394bc0193 (diff)
parent85144f0cd1becd778c0bc4572fa413014ee1ca66 (diff)
downloadredot-engine-27679dbfa4ee5a4f0356a83484fc4698226b0de4.tar.gz
Merge pull request #83937 from Jordyfel/potential-crash-on-move
Fix potential crash on failed move
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index a491a9b214..afefd38b20 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -1554,7 +1554,9 @@ 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 {
// Update the paths in ResourceUID, so that UIDs remain valid.
for (const KeyValue<String, ResourceUID::ID> &pair : p_uids) {
- ResourceUID::get_singleton()->set_id(pair.value, p_renames[pair.key]);
+ if (p_renames.has(pair.key)) {
+ ResourceUID::get_singleton()->set_id(pair.value, p_renames[pair.key]);
+ }
}
// Rename all resources loaded, be it subresources or actual resources.