Skip to content

Commit

Permalink
Handle the case where the event received has no arguments as passing …
Browse files Browse the repository at this point in the history
…null to WriteLine causes an exception. (#2962)
  • Loading branch information
iNinja authored Nov 1, 2024
1 parent 4b0cfc2 commit 671e2a2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public void EnsureAotCompatibility()
CreateNoWindow = true,
WorkingDirectory = testAppPath
};
process.OutputDataReceived += (sender, e) => _testOutputHelper.WriteLine(e.Data);
process.OutputDataReceived += (sender, eventArgs) =>
{
if (eventArgs.Data is not null)
_testOutputHelper.WriteLine(eventArgs.Data);
};
process.Start();
process.BeginOutputReadLine();

Expand Down

0 comments on commit 671e2a2

Please sign in to comment.