Skip to content

Commit

Permalink
Fixed named param autocomplete crash
Browse files Browse the repository at this point in the history
  • Loading branch information
bfiete committed Sep 5, 2022
1 parent 03c56b4 commit 5490af4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions IDEHelper/Compiler/BfCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 5490af4

Please sign in to comment.