Skip to content

Commit

Permalink
OmniSharpDocumentSymbolHandler.cs: a fix for a crash in 'textDocument…
Browse files Browse the repository at this point in the history
…/documentSymbol'

The NRE may happen when OS.R.CS.Services.SStructre.CodeStructureService
returns a null during the time when projects are still being loaded but
LSP client already sends queries for symbol info under cursor.

Related to OmniSharp#2141
  • Loading branch information
razzmatazz committed May 1, 2021
1 parent d52c76d commit 7da7b12
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -41,7 +41,7 @@ public override async Task<SymbolInformationOrDocumentSymbolContainer> Handle(Do

var omnisharpResponse = await _codeStructureHandler.Handle(omnisharpRequest);

return omnisharpResponse.Elements?.Select(ToDocumentSymbolInformationOrDocumentSymbol).ToArray() ??
return omnisharpResponse?.Elements?.Select(ToDocumentSymbolInformationOrDocumentSymbol).ToArray() ??
Array.Empty<SymbolInformationOrDocumentSymbol>();
}

Expand Down

0 comments on commit 7da7b12

Please sign in to comment.