Skip to content

Commit

Permalink
Tolerate null eventArgs.Message in MockLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
rainersigwald committed Oct 25, 2024
1 parent 69b3e7a commit d671409
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/UnitTests.Shared/MockLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public void LoggerEventHandler(object sender, BuildEventArgs eventArgs)
bool logMessage = !(eventArgs is BuildFinishedEventArgs) || LogBuildFinished;
if (logMessage)
{
string msg = eventArgs.Message;
string msg = eventArgs.Message ?? $"(null message in {eventArgs.GetType().Name} event)";
if (eventArgs is BuildMessageEventArgs m && m.LineNumber != 0)
{
msg = $"{m.File}({m.LineNumber},{m.ColumnNumber}): {msg}";
Expand Down

0 comments on commit d671409

Please sign in to comment.