Skip to content

Commit

Permalink
avoid NRE when document is null (#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipw committed May 27, 2021
1 parent 71caabb commit 35fec36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OmniSharp.Roslyn.CSharp/Helpers/LocationExtensions.cs
Expand Up @@ -42,7 +42,7 @@ static SourceText GetSourceText(Location location, IEnumerable<Document> documen
if (hasMappedPath)
{
SourceText source = null;
if (documents != null && documents.FirstOrDefault(d => d.TryGetText(out source)) != null)
if (documents != null && documents.FirstOrDefault(d => d != null && d.TryGetText(out source)) != null)
{
// we have a mapped document that exists in workspace
return source;
Expand Down

0 comments on commit 35fec36

Please sign in to comment.