Skip to content

Commit

Permalink
Fix nullref.
Browse files Browse the repository at this point in the history
See #35
  • Loading branch information
KirillOsenkov authored and alexperovich committed Mar 13, 2020
1 parent 6e10804 commit 5210eb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task<IEnumerable<Range>> Classify(Document document, SourceText tex
catch (Exception ex)
{
Log.Exception(ex, "Exception during Classification of document: " + document.FilePath);
return null;
return Array.Empty<Range>();
}

// Roslyn 3.0.0 introduced `Symbol - Static` as an "additive" classification, meaning that multiple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private async Task GenerateHtml(StreamWriter writer)
writer.Write(prefix);
GenerateHeader(writer.WriteLine);

var ranges = (await classifier.Classify(Document, Text)).ToArray();
var ranges = (await classifier.Classify(Document, Text))?.ToArray();

// pass a value larger than 0 to generate line numbers statically at HTML generation time
var table = Markup.GetTablePrefix(
Expand Down

0 comments on commit 5210eb1

Please sign in to comment.