From 92456aa83815ecd7ee34ebc96252781db5fc5973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Fri, 4 Oct 2024 14:32:42 +0200 Subject: [PATCH] Avoid terminating the process if not mandatory --- ArchiSteamFarm/Program.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index b1fbfcd3f31cb..bef84fd064d7e 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -526,7 +526,10 @@ private static async void OnUnhandledException(object? sender, UnhandledExceptio ArgumentNullException.ThrowIfNull(e.ExceptionObject); await ASF.ArchiLogger.LogFatalException((Exception) e.ExceptionObject).ConfigureAwait(false); - await Exit(1).ConfigureAwait(false); + + if (e.IsTerminating) { + await Exit(1).ConfigureAwait(false); + } } private static async void OnUnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e) {