1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Apply suggestions from code review

Co-authored-by: Nordsoft91 <nordsoft@yahoo.com>
This commit is contained in:
Ivan Savenko 2023-10-29 13:47:56 +02:00 committed by GitHub
parent feae8b6ae4
commit be5505690d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,9 +194,9 @@ TObjectTypeHandler CObjectClassesHandler::loadSubObjectFromJson(const std::strin
assert(!scope.empty());
std::string handler = obj->handlerName;
if(!handlerConstructors.count(obj->handlerName))
if(!handlerConstructors.count(handler))
{
logMod->error("Handler with name %s was not found!", obj->handlerName);
logMod->error("Handler with name %s was not found!", handler);
// workaround for potential crash - if handler does not exists, continue with generic handler that is used for objects without any custom logc
handler = "generic";
assert(handlerConstructors.count(handler) != 0);