diff --git a/src/Tgstation.Server.Host/Components/Watchdog/Session.cs b/src/Tgstation.Server.Host/Components/Watchdog/Session.cs index b585b32315..a26f14e130 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/Session.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/Session.cs @@ -57,8 +57,16 @@ namespace Tgstation.Server.Host.Components.Watchdog return result; }, default, TaskCreationOptions.LongRunning, TaskScheduler.Current); lifetimeTask = new TaskCompletionSource(); - process.EnableRaisingEvents = true; - process.Exited += (a, b) => lifetimeTask.SetResult(process.ExitCode); + try + { + process.EnableRaisingEvents = true; + process.Exited += (a, b) => lifetimeTask.TrySetResult(process.ExitCode); + } + catch (InvalidOperationException) + { + //dead proccess + lifetimeTask.TrySetResult(process.ExitCode); + } } ///