Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Core/Mods/JsgmeFileInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public static void UninstallFiles(string dstPath, IEnumerable<string> files, Act
/// <param name="skip">Function to decide if a file should be skipped</param>
public static void UninstallFiles(string dstPath, IEnumerable<string> files, Action<string> fileUninstalledCallback, ShouldSkipFile skip)
{
foreach (var file in files)
var fileList = files.ToList(); // It must be enumerated twice
foreach (var file in fileList)
{
var path = Path.Combine(dstPath, file);
// Some mods have duplicate entries, so files might have been removed already
Expand All @@ -120,7 +121,7 @@ public static void UninstallFiles(string dstPath, IEnumerable<string> files, Act
RestoreFile(path);
fileUninstalledCallback(file);
}
DeleteEmptyDirectories(dstPath, files);
DeleteEmptyDirectories(dstPath, fileList);
}

private static void DeleteEmptyDirectories(string dstRootPath, IEnumerable<string> filePaths) {
Expand Down