Skip to content

Commit

Permalink
Avoid possible race with HasLoadError.
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedpammer committed Apr 8, 2021
1 parent 3081e52 commit c67f204
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ILSpy/AssemblyList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,16 @@ public async Task<IList<LoadedAssembly>> GetAllAssemblies()

foreach (var asm in assemblies)
{
if (asm.HasLoadError)
LoadedAssembly.LoadResult result;
try
{
result = await asm.GetLoadResultAsync();
}
catch
{
results.Add(asm);
continue;
}

var result = await asm.GetLoadResultAsync();
if (result.Package != null)
{
AddDescendants(result.Package.RootFolder);
Expand Down

0 comments on commit c67f204

Please sign in to comment.