Merge pull request #96127 from RedOrbweaver/fix_msbuild_logger_crash
[3.x] Fix MSBuild logger exception thrown when processing a warning or an error with no associated file
This commit is contained in:
commit
db511879f0
|
@ -88,7 +88,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);
|
||||||
|
@ -103,7 +103,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);
|
||||||
|
|
Loading…
Reference in New Issue