diff --git a/chibild/chibild.core/Internal/Utilities.cs b/chibild/chibild.core/Internal/Utilities.cs index e21a4a2..fdcd282 100644 --- a/chibild/chibild.core/Internal/Utilities.cs +++ b/chibild/chibild.core/Internal/Utilities.cs @@ -158,8 +158,7 @@ public static void SafeCopy(string from, string to) } catch { - File.Delete(to1); - throw; + isExistTo = false; } } @@ -172,9 +171,16 @@ public static void SafeCopy(string from, string to) File.Delete(to1); if (isExistTo) { - File.Move(to2, to); + try + { + File.Move(to2, to); + } + catch + { + File.Delete(to2); + } } - throw; + return; } if (isExistTo) @@ -182,4 +188,4 @@ public static void SafeCopy(string from, string to) File.Delete(to2); } } -} \ No newline at end of file +}