1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Null check in CeContext::GetCustomAttribute

This commit is contained in:
Brian Fiete 2022-05-13 12:26:38 -07:00
parent ebd341e311
commit 2388ae46ff

View file

@ -3921,7 +3921,7 @@ bool CeContext::GetCustomAttribute(BfModule* module, BfIRConstHolder* constHolde
if (!value)
Fail("Failed to encoded attribute");
auto attrConstant = module->mBfIRBuilder->GetConstant(value);
if (!WriteConstant(module, resultAddr, attrConstant, customAttr->mType))
if ((attrConstant == NULL) || (!WriteConstant(module, resultAddr, attrConstant, customAttr->mType)))
Fail("Failed to decode attribute");
}