Skip to content

Commit 09a80dd

Browse files
committed
Updated null check for getting CompletionMatches so results or results.CompletionMatches could be null.
1 parent a9c7e79 commit 09a80dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ internal async Task<CompletionResults> GetCompletionsInFileAsync(
215215
_logger,
216216
cancellationToken).ConfigureAwait(false);
217217

218-
if (result is null || result.CompletionMatches.Count is 0)
218+
if (!(result?.CompletionMatches?.Count > 0))
219219
{
220220
return new CompletionResults(IsIncomplete: true, Array.Empty<CompletionItem>());
221221
}

0 commit comments

Comments
 (0)