From 2388ae46ff568672fef1c10d6be1ff780a2ff336 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 13 May 2022 12:26:38 -0700 Subject: [PATCH] Null check in CeContext::GetCustomAttribute --- IDEHelper/Compiler/CeMachine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/CeMachine.cpp b/IDEHelper/Compiler/CeMachine.cpp index 69a697ef..88c2167c 100644 --- a/IDEHelper/Compiler/CeMachine.cpp +++ b/IDEHelper/Compiler/CeMachine.cpp @@ -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"); }