1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Fix crash if ID not exists

This commit is contained in:
Laserlicht
2025-08-17 16:55:03 +02:00
committed by GitHub
parent 06dbe32c77
commit f7adb39551

View File

@@ -418,7 +418,8 @@ std::vector<CIdentifierStorage::ObjectData> CIdentifierStorage::getPossibleIdent
}
std::string fullID = request.type + '.' + request.name;
std::string fullIDCaseCorrected = request.caseSensitive ? fullID : registeredObjectsCaseLookup.at(boost::algorithm::to_lower_copy(fullID));
std::string fullLowerID = boost::algorithm::to_lower_copy(fullID);
std::string fullIDCaseCorrected = (request.caseSensitive || !registeredObjectsCaseLookup.count(fullLowerID)) ? fullID : registeredObjectsCaseLookup.at(fullLowerID);
auto entries = registeredObjects.equal_range(fullIDCaseCorrected);