Avoid ASF crash in #1283

Won't solve the misconfiguration caused by the user, but ASF crash can be avoided at this stage.
This commit is contained in:
JustArchi
2019-06-14 13:53:28 +02:00
parent f9b5e40fb3
commit 8dd75d5313

View File

@@ -100,13 +100,14 @@ namespace ArchiSteamFarm.IPC {
Logging.InitHistoryLogger(); Logging.InitHistoryLogger();
// Start the server // Start the server
IWebHost kestrelWebHost = builder.Build(); IWebHost kestrelWebHost = null;
try { try {
kestrelWebHost = builder.Build();
await kestrelWebHost.StartAsync().ConfigureAwait(false); await kestrelWebHost.StartAsync().ConfigureAwait(false);
} catch (Exception e) { } catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e); ASF.ArchiLogger.LogGenericException(e);
kestrelWebHost.Dispose(); kestrelWebHost?.Dispose();
return; return;
} }