Skip to content

Commit

Permalink
[Sophon] Fix errors when installing games with Sophon mode
Browse files Browse the repository at this point in the history
This is caused by for some reason the List got modified during processing, causing the enumerator to fail.
This commit fixed it by copying the List inside the RunTaskAction so the inner value should not get modified by any outside method
  • Loading branch information
bagusnl committed Dec 24, 2024
1 parent f1d3e75 commit 01cc759
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,8 @@ async Task RunTaskAction(HttpClient client, List<SophonChunkManifestInfoPair> so
{
LauncherConfig.DownloadSpeedLimitChanged += downloadSpeedLimiter.GetListener();
var processingInfoPair = new ConcurrentDictionary<SophonChunksInfo, byte>();
foreach (SophonChunkManifestInfoPair sophonDownloadInfoPair in sophonInfoPairList)
var infoPairListCopy = sophonInfoPairList.ToList();
foreach (SophonChunkManifestInfoPair sophonDownloadInfoPair in infoPairListCopy)
{
if (!processingInfoPair.TryAdd(sophonDownloadInfoPair.ChunksInfo, 0))
{
Expand Down

0 comments on commit 01cc759

Please sign in to comment.