Skip to content

Commit bec4dba

Browse files
committed
Do not crash on invalid IPC.config
Log error and continue without IPC instead
1 parent 7e9b5ee commit bec4dba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ArchiSteamFarm/IPC/ArchiKestrel.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,15 +534,19 @@ private static async Task StartInternally() {
534534
// Init history logger for /Api/Log usage
535535
Logging.InitHistoryLogger();
536536

537-
WebApplication webApplication = await CreateWebApplication().ConfigureAwait(false);
537+
WebApplication? webApplication = null;
538538

539539
try {
540540
// Start the server
541+
webApplication = await CreateWebApplication().ConfigureAwait(false);
542+
541543
await webApplication.StartAsync().ConfigureAwait(false);
542544
} catch (Exception e) {
543545
ASF.ArchiLogger.LogGenericException(e);
544546

545-
await webApplication.DisposeAsync().ConfigureAwait(false);
547+
if (webApplication != null) {
548+
await webApplication.DisposeAsync().ConfigureAwait(false);
549+
}
546550

547551
return;
548552
}

0 commit comments

Comments
 (0)