From dacebc0eaa514c1bf0e853b8b9599a4586fa841b Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Sun, 14 Feb 2021 17:04:27 +0800 Subject: [PATCH] TryCatch CleanOld File.Delete --- Netch/Updater/Updater.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Netch/Updater/Updater.cs b/Netch/Updater/Updater.cs index 16436bde..486d8a0a 100644 --- a/Netch/Updater/Updater.cs +++ b/Netch/Updater/Updater.cs @@ -148,7 +148,14 @@ namespace Netch.Updater public static void CleanOld() { foreach (var f in Directory.GetFiles(Global.NetchDir, "*.old", SearchOption.AllDirectories)) - File.Delete(f); + try + { + File.Delete(f); + } + catch (Exception) + { + // ignored + } } } } \ No newline at end of file