adding null check for firstSymbol

This commit is contained in:
davu 2022-11-10 15:19:41 +01:00 committed by Jan Jurzitza
parent 6c3a4d3797
commit 4fd12cf485
1 changed files with 4 additions and 0 deletions

View File

@ -173,6 +173,10 @@ bool doUFCSSearch(string beforeToken, string lastToken)
void getUFCSParenCompletion(ref DSymbol*[] symbols, Scope* completionScope, istring firstToken, istring nextToken, size_t cursorPosition)
{
DSymbol* firstSymbol = completionScope.getFirstSymbolByNameAndCursor(firstToken, cursorPosition);
if (firstSymbol is null)
return;
DSymbol*[] possibleUFCSSymbol = completionScope.getSymbolsByNameAndCursor(nextToken, cursorPosition);
foreach(nextSymbol; possibleUFCSSymbol){
if (nextSymbol && nextSymbol.functionParameters)