From 9722059bb0bc5b8b65aae434994089768f2d8a80 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Tue, 27 Dec 2016 16:18:42 +0100 Subject: [PATCH] Don't crash on SteamDirectory failure --- ArchiSteamFarm/Bot.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 64da7f23e..12bc7870e 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -314,8 +314,13 @@ namespace ArchiSteamFarm { // Normally we wouldn't need to do this, but there is a case where our list might be invalid or outdated // Ensure that we always ask once for list of up-to-date servers, even if we have list saved Program.ArchiLogger.LogGenericInfo("Initializing SteamDirectory..."); - await SteamDirectory.Initialize(cellID).ConfigureAwait(false); - Program.ArchiLogger.LogGenericInfo("Done!"); + + try { + await SteamDirectory.Initialize(cellID).ConfigureAwait(false); + Program.ArchiLogger.LogGenericInfo("Done!"); + } catch { + Program.ArchiLogger.LogGenericWarning("Could not initialize SteamDirectory, connecting with Steam Network might take much longer than usual!"); + } } internal async Task LootIfNeeded() {