From 01eb80c3d44f24c714722308710fbdbbfba4083a Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sun, 13 Oct 2024 10:10:08 -0400 Subject: [PATCH] Added interface NULL check in BfBaseClassWalker --- IDEHelper/Compiler/BfExprEvaluator.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 10875f94..c46831ac 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -104,22 +104,26 @@ void BfBaseClassWalker::AddConstraints(BfType* srcType, BfGenericParamInstance* if (genericParam->mTypeConstraint != NULL) { auto typeInst = genericParam->mTypeConstraint->ToTypeInstance(); + if (typeInst != NULL) { if (typeInst->IsInterface()) AddInterfaces(srcType, typeInst->ToTypeInstance()); Entry entry(srcType, typeInst); - if ((typeInst != NULL) && (!mManualList.Contains(entry))) + if (!mManualList.Contains(entry)) mManualList.Add(entry); } } for (auto typeInst : genericParam->mInterfaceConstraints) { - if (typeInst->IsInterface()) - AddInterfaces(srcType, typeInst->ToTypeInstance()); - Entry entry(srcType, typeInst); - if ((typeInst != NULL) && (!mManualList.Contains(entry))) - mManualList.Add(entry); + if (typeInst != NULL) + { + if (typeInst->IsInterface()) + AddInterfaces(srcType, typeInst->ToTypeInstance()); + Entry entry(srcType, typeInst); + if (!mManualList.Contains(entry)) + mManualList.Add(entry); + } } }