Skip to content

Commit 671e2a2

Browse files
authored
Handle the case where the event received has no arguments as passing null to WriteLine causes an exception. (#2962)
1 parent 4b0cfc2 commit 671e2a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/Microsoft.IdentityModel.AotCompatibility.Tests/AotCompatibilityTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ public void EnsureAotCompatibility()
5454
CreateNoWindow = true,
5555
WorkingDirectory = testAppPath
5656
};
57-
process.OutputDataReceived += (sender, e) => _testOutputHelper.WriteLine(e.Data);
57+
process.OutputDataReceived += (sender, eventArgs) =>
58+
{
59+
if (eventArgs.Data is not null)
60+
_testOutputHelper.WriteLine(eventArgs.Data);
61+
};
5862
process.Start();
5963
process.BeginOutputReadLine();
6064

0 commit comments

Comments
 (0)