From 2130715f216c398c83625989a6d072cdf7fe6f64 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sat, 5 Feb 2022 10:39:05 -0500 Subject: [PATCH] null checks --- IDEHelper/Compiler/BfModule.cpp | 3 +++ IDEHelper/Compiler/BfModuleTypeUtils.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 4b28ab3f..c7834209 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -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) { + if (customAttributes == NULL) + return; + auto _AddDeclarationMoreInfo = [&]() { if (methodInstance != NULL) diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index 58e2bae5..ea558406 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -11479,6 +11479,12 @@ BfType* BfModule::ResolveTypeRef_Type(BfAstNode* astNode, const BfSizedArray* genericArgs, BfPopulateType populateType, BfResolveTypeRefFlags resolveFlags) { + if (astNode == NULL) + { + AssertErrorState(); + return NULL; + } + if (auto typeRef = BfNodeDynCast(astNode)) return ResolveTypeRef(typeRef, populateType, resolveFlags);