From 5490af46903312351aa7b5087736893dbb561d98 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 5 Sep 2022 09:40:49 -0700 Subject: [PATCH] Fixed named param autocomplete crash --- IDEHelper/Compiler/BfCompiler.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/IDEHelper/Compiler/BfCompiler.cpp b/IDEHelper/Compiler/BfCompiler.cpp index d3c10975..43d364e3 100644 --- a/IDEHelper/Compiler/BfCompiler.cpp +++ b/IDEHelper/Compiler/BfCompiler.cpp @@ -8180,11 +8180,14 @@ void BfCompiler::GenerateAutocompleteInfo() auto& bestInstance = methodMatchInfo->mInstanceList[methodMatchInfo->mBestIdx]; auto bestMethodDef = bestInstance.mMethodDef; - for (int paramIdx = 0; paramIdx < bestMethodDef->mParams.mSize; paramIdx++) + if (bestMethodDef != NULL) { - if ((paramIdx == 0) && (bestMethodDef->mMethodType == BfMethodType_Extension)) - continue; - autoComplete->AddEntry(AutoCompleteEntry("param", bestMethodDef->mParams[paramIdx]->mName + ":"), filter); + for (int paramIdx = 0; paramIdx < bestMethodDef->mParams.mSize; paramIdx++) + { + if ((paramIdx == 0) && (bestMethodDef->mMethodType == BfMethodType_Extension)) + continue; + autoComplete->AddEntry(AutoCompleteEntry("param", bestMethodDef->mParams[paramIdx]->mName + ":"), filter); + } } }