mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
fix dereference of end iterator
This commit is contained in:
parent
e4de869db6
commit
bd36ba19b3
1 changed files with 3 additions and 3 deletions
|
@ -1106,7 +1106,7 @@ bool AssetServer::renameMapping(AssetPath oldPath, AssetPath newPath) {
|
|||
_fileMappings.erase(it);
|
||||
|
||||
// in case we're overwriting, keep the current destination mapping for potential rollback
|
||||
auto oldDestinationMapping = _fileMappings.find(newPath)->second;
|
||||
auto oldDestinationIt = _fileMappings.find(newPath);
|
||||
|
||||
if (!oldSourceMapping.isEmpty()) {
|
||||
_fileMappings[newPath] = oldSourceMapping;
|
||||
|
@ -1120,9 +1120,9 @@ bool AssetServer::renameMapping(AssetPath oldPath, AssetPath newPath) {
|
|||
// we couldn't persist the renamed mapping, rollback and return failure
|
||||
_fileMappings[oldPath] = oldSourceMapping;
|
||||
|
||||
if (!oldDestinationMapping.isNull()) {
|
||||
if (oldDestinationIt != _fileMappings.end()) {
|
||||
// put back the overwritten mapping for the destination path
|
||||
_fileMappings[newPath] = oldDestinationMapping;
|
||||
_fileMappings[newPath] = oldDestinationIt->second;
|
||||
} else {
|
||||
// clear the new mapping
|
||||
_fileMappings.erase(_fileMappings.find(newPath));
|
||||
|
|
Loading…
Reference in a new issue