1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +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

View File

@ -194,9 +194,9 @@ TObjectTypeHandler CObjectClassesHandler::loadSubObjectFromJson(const std::strin
assert(!scope.empty()); assert(!scope.empty());
std::string handler = obj->handlerName; 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 // workaround for potential crash - if handler does not exists, continue with generic handler that is used for objects without any custom logc
handler = "generic"; handler = "generic";
assert(handlerConstructors.count(handler) != 0); assert(handlerConstructors.count(handler) != 0);