mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 15:07:03 +01:00
Fix a ProcessExecutor bug
This commit is contained in:
@@ -23,7 +23,19 @@ namespace Tgstation.Server.Host.Core
|
||||
{
|
||||
handle.EnableRaisingEvents = true;
|
||||
var tcs = new TaskCompletionSource<int>();
|
||||
handle.Exited += (a, b) => tcs.SetResult(handle.ExitCode);
|
||||
handle.Exited += (a, b) =>
|
||||
{
|
||||
int exitCode;
|
||||
try
|
||||
{
|
||||
exitCode = handle.ExitCode;
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
tcs.SetResult(exitCode);
|
||||
};
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user