From 215c62b78ae9491b338222fc0bbcd2bc3bb4513f Mon Sep 17 00:00:00 2001 From: JustArchi Date: Wed, 11 Jan 2017 14:18:40 +0100 Subject: [PATCH] Don't crach on IOException --- ArchiSteamFarm/Program.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index 02bcfca19..4d17082df 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -171,8 +171,12 @@ namespace ArchiSteamFarm { // If debugging is on, we prepare debug directory prior to running if (GlobalConfig.Debug) { if (Directory.Exists(SharedInfo.DebugDirectory)) { - Directory.Delete(SharedInfo.DebugDirectory, true); - await Task.Delay(1000).ConfigureAwait(false); // Dirty workaround giving Windows some time to sync + try { + Directory.Delete(SharedInfo.DebugDirectory, true); + await Task.Delay(1000).ConfigureAwait(false); // Dirty workaround giving Windows some time to sync + } catch (IOException e) { + ArchiLogger.LogGenericException(e); + } } Directory.CreateDirectory(SharedInfo.DebugDirectory);