Skip to content

Commit 4fd12cf

Browse files
vushuWebFreak001
authored andcommitted
adding null check for firstSymbol
1 parent 6c3a4d3 commit 4fd12cf

File tree

1 file changed

+4
-0
lines changed
  • src/dcd/server/autocomplete

1 file changed

+4
-0
lines changed

src/dcd/server/autocomplete/ufcs.d

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ bool doUFCSSearch(string beforeToken, string lastToken)
173173
void getUFCSParenCompletion(ref DSymbol*[] symbols, Scope* completionScope, istring firstToken, istring nextToken, size_t cursorPosition)
174174
{
175175
DSymbol* firstSymbol = completionScope.getFirstSymbolByNameAndCursor(firstToken, cursorPosition);
176+
177+
if (firstSymbol is null)
178+
return;
179+
176180
DSymbol*[] possibleUFCSSymbol = completionScope.getSymbolsByNameAndCursor(nextToken, cursorPosition);
177181
foreach(nextSymbol; possibleUFCSSymbol){
178182
if (nextSymbol && nextSymbol.functionParameters)

0 commit comments

Comments
 (0)