1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 14:24:10 +02:00

Added interface NULL check in BfBaseClassWalker

This commit is contained in:
Brian Fiete 2024-10-13 10:10:08 -04:00
parent 4589e7ea0e
commit 01eb80c3d4

View file

@ -104,22 +104,26 @@ void BfBaseClassWalker::AddConstraints(BfType* srcType, BfGenericParamInstance*
if (genericParam->mTypeConstraint != NULL) if (genericParam->mTypeConstraint != NULL)
{ {
auto typeInst = genericParam->mTypeConstraint->ToTypeInstance(); auto typeInst = genericParam->mTypeConstraint->ToTypeInstance();
if (typeInst != NULL)
{ {
if (typeInst->IsInterface()) if (typeInst->IsInterface())
AddInterfaces(srcType, typeInst->ToTypeInstance()); AddInterfaces(srcType, typeInst->ToTypeInstance());
Entry entry(srcType, typeInst); Entry entry(srcType, typeInst);
if ((typeInst != NULL) && (!mManualList.Contains(entry))) if (!mManualList.Contains(entry))
mManualList.Add(entry); mManualList.Add(entry);
} }
} }
for (auto typeInst : genericParam->mInterfaceConstraints) for (auto typeInst : genericParam->mInterfaceConstraints)
{ {
if (typeInst->IsInterface()) if (typeInst != NULL)
AddInterfaces(srcType, typeInst->ToTypeInstance()); {
Entry entry(srcType, typeInst); if (typeInst->IsInterface())
if ((typeInst != NULL) && (!mManualList.Contains(entry))) AddInterfaces(srcType, typeInst->ToTypeInstance());
mManualList.Add(entry); Entry entry(srcType, typeInst);
if (!mManualList.Contains(entry))
mManualList.Add(entry);
}
} }
} }