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

null checks

This commit is contained in:
Brian Fiete 2022-02-05 10:39:05 -05:00
parent cf5c969d1f
commit 2130715f21
2 changed files with 9 additions and 0 deletions

View file

@ -3240,6 +3240,9 @@ BfError* BfModule::Warn(int warningNum, const StringImpl& warning, BfAstNode* re
void BfModule::CheckErrorAttributes(BfTypeInstance* typeInstance, BfMethodInstance* methodInstance, BfCustomAttributes* customAttributes, BfAstNode* targetSrc) void BfModule::CheckErrorAttributes(BfTypeInstance* typeInstance, BfMethodInstance* methodInstance, BfCustomAttributes* customAttributes, BfAstNode* targetSrc)
{ {
if (customAttributes == NULL)
return;
auto _AddDeclarationMoreInfo = [&]() auto _AddDeclarationMoreInfo = [&]()
{ {
if (methodInstance != NULL) if (methodInstance != NULL)

View file

@ -11479,6 +11479,12 @@ BfType* BfModule::ResolveTypeRef_Type(BfAstNode* astNode, const BfSizedArray<BfA
BfType* BfModule::ResolveTypeRef(BfAstNode* astNode, const BfSizedArray<BfAstNode*>* genericArgs, BfPopulateType populateType, BfResolveTypeRefFlags resolveFlags) BfType* BfModule::ResolveTypeRef(BfAstNode* astNode, const BfSizedArray<BfAstNode*>* genericArgs, BfPopulateType populateType, BfResolveTypeRefFlags resolveFlags)
{ {
if (astNode == NULL)
{
AssertErrorState();
return NULL;
}
if (auto typeRef = BfNodeDynCast<BfTypeReference>(astNode)) if (auto typeRef = BfNodeDynCast<BfTypeReference>(astNode))
return ResolveTypeRef(typeRef, populateType, resolveFlags); return ResolveTypeRef(typeRef, populateType, resolveFlags);