diff --git a/autogen/src/object/codegen.cpp b/autogen/src/object/codegen.cpp index eb0c62f..dc3f117 100644 --- a/autogen/src/object/codegen.cpp +++ b/autogen/src/object/codegen.cpp @@ -44,7 +44,7 @@ static std::string castFromVariant(std::string valueStr, std::string fieldType) } std::string mappedType = MAPPED_TYPE[fieldType]; - return valueStr + ".get<" + (!mappedType.empty() ? mappedType : fieldType) + ">()"; + return "(" + fieldType + ")" + valueStr + ".get<" + (!mappedType.empty() ? mappedType : fieldType) + ">()"; } static std::string castToVariant(std::string valueStr, std::string fieldType) { diff --git a/core/src/objects/base/service.cpp b/core/src/objects/base/service.cpp index f183884..3fd3474 100644 --- a/core/src/objects/base/service.cpp +++ b/core/src/objects/base/service.cpp @@ -9,7 +9,7 @@ Service::Service(const InstanceType* type) : Instance(type){} // Fail if parented to non-datamodel, otherwise lock parent void Service::OnParentUpdated(std::optional> oldParent, std::optional> newParent) { if (!newParent || newParent.value()->GetClass() != &DataModel::TYPE) { - Logger::fatalErrorf("Service %s was parented to object of type %s", GetClass()->className, newParent ? newParent.value()->GetClass()->className : "NULL"); + Logger::fatalErrorf("Service %s was parented to object of type %s", GetClass()->className.c_str(), newParent ? newParent.value()->GetClass()->className.c_str() : "NULL"); panic(); }