Merge pull request #96293 from RedOrbweaver/fix_msbuild_logger

C#: Fix build logger unable to handle an event without an associated file
This commit is contained in:
Rémi Verschelde 2024-08-30 09:59:51 +02:00
commit 69d6106d4d
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ namespace GodotTools.BuildLogger
WriteLine(line); WriteLine(line);
string errorLine = $@"error,{e.File.CsvEscape()},{e.LineNumber},{e.ColumnNumber}," + string errorLine = $@"error,{e.File?.CsvEscape() ?? string.Empty},{e.LineNumber},{e.ColumnNumber}," +
$"{e.Code?.CsvEscape() ?? string.Empty},{e.Message.CsvEscape()}," + $"{e.Code?.CsvEscape() ?? string.Empty},{e.Message.CsvEscape()}," +
$"{e.ProjectFile?.CsvEscape() ?? string.Empty}"; $"{e.ProjectFile?.CsvEscape() ?? string.Empty}";
_issuesStreamWriter.WriteLine(errorLine); _issuesStreamWriter.WriteLine(errorLine);
@ -101,7 +101,7 @@ namespace GodotTools.BuildLogger
WriteLine(line); WriteLine(line);
string warningLine = $@"warning,{e.File.CsvEscape()},{e.LineNumber},{e.ColumnNumber}," + string warningLine = $@"warning,{e.File?.CsvEscape() ?? string.Empty},{e.LineNumber},{e.ColumnNumber}," +
$"{e.Code?.CsvEscape() ?? string.Empty},{e.Message.CsvEscape()}," + $"{e.Code?.CsvEscape() ?? string.Empty},{e.Message.CsvEscape()}," +
$"{e.ProjectFile?.CsvEscape() ?? string.Empty}"; $"{e.ProjectFile?.CsvEscape() ?? string.Empty}";
_issuesStreamWriter.WriteLine(warningLine); _issuesStreamWriter.WriteLine(warningLine);