Skip to content

Commit

Permalink
Merge pull request #2350 from mavasani/CodeMetricsBugFix
Browse files Browse the repository at this point in the history
Fix CodeMetrics output writer to handle null source tree for non-sour…
  • Loading branch information
mavasani committed Apr 17, 2019
2 parents 65c7235 + f6a7e09 commit 0c3907f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tools/MetricsOutputWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void writeHeader()
case SymbolKind.Property:
var location = data.Symbol.Locations.First();
writer.WriteAttributeString("Name", data.Symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
writer.WriteAttributeString("File", location.SourceTree.FilePath);
writer.WriteAttributeString("File", location.SourceTree?.FilePath ?? "UNKNOWN");
writer.WriteAttributeString("Line", (location.GetLineSpan().StartLinePosition.Line + 1).ToString());
break;

Expand Down

0 comments on commit 0c3907f

Please sign in to comment.