fix: crash on trying to generate for specific asset

This commit is contained in:
Jan Laupetin 2025-04-28 09:48:34 +02:00 committed by Jan
parent 2eefad105e
commit d938f91541
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C

View File

@ -64,14 +64,14 @@ bool CodeGenerator::GetAssetWithName(IDataRepository* repository, const std::str
}
auto* defWithMembers = dynamic_cast<DefinitionWithMembers*>(def);
auto* info = defWithMembers != nullptr ? repository->GetInformationFor(defWithMembers) : nullptr;
if (info == nullptr)
asset = defWithMembers != nullptr ? repository->GetInformationFor(defWithMembers) : nullptr;
if (asset == nullptr)
{
std::cerr << std::format("Could not find type with name '{}'\n", name);
return false;
}
if (!StructureComputations(info).IsAsset())
if (!StructureComputations(asset).IsAsset())
{
std::cerr << std::format("Type is not an asset '{}'\n", name);
return false;