From b49abd03a322819c5d42c1a2b7e1bf8243cb54cb Mon Sep 17 00:00:00 2001 From: kianzzarrin Date: Tue, 4 Oct 2022 21:31:20 +0300 Subject: [PATCH] fixed: false positive error report when moving mods. --- LoadOrderInjections/Injections/SubscriptionManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LoadOrderInjections/Injections/SubscriptionManager.cs b/LoadOrderInjections/Injections/SubscriptionManager.cs index 8f64e9e..e24a24b 100644 --- a/LoadOrderInjections/Injections/SubscriptionManager.cs +++ b/LoadOrderInjections/Injections/SubscriptionManager.cs @@ -889,7 +889,7 @@ public static string ToSTR(this ref UGCDetails result) try { Log.Called(); var dirs = new HashSet(RootDir.GetDirectories().Select(item => item.FullName)); - foreach (var dir in dirs) { + foreach (var dir in dirs.ToArray() /* need clone*/) { try { string path1 = ToIncludedPath(dir); string path2 = ToExcludedPath2(dir); @@ -900,6 +900,7 @@ public static string ToSTR(this ref UGCDetails result) $"path2 exists: '{path2}' failed. dirs.Contains(path2)={dirs.Contains(path2)}"); Directory.Delete(path2, true); Directory.Move(path1, path2); + dirs.Remove(path1); } } catch(Exception ex) { ex.Log($"dir='{dir}', dirs='{dirs.ToSTR()}'",false);