Browse Source

Fix #997: Any assembly with load error in the list would cause ILSpy to stop decompiling anything.

pull/998/merge
Siegfried Pammer 8 years ago
parent
commit
ead9c0f41c
  1. 12
      ILSpy/LoadedAssembly.cs

12
ILSpy/LoadedAssembly.cs

@ -67,7 +67,7 @@ namespace ICSharpCode.ILSpy
/// <summary> /// <summary>
/// Gets the Cecil ModuleDefinition. /// Gets the Cecil ModuleDefinition.
/// Can be null when there was a load error. /// Can return null when there was a load error.
/// </summary> /// </summary>
public Task<ModuleDefinition> GetModuleDefinitionAsync() public Task<ModuleDefinition> GetModuleDefinitionAsync()
{ {
@ -76,12 +76,16 @@ namespace ICSharpCode.ILSpy
/// <summary> /// <summary>
/// Gets the Cecil AssemblyDefinition. /// Gets the Cecil AssemblyDefinition.
/// Is null when there was a load error; or when opening a netmodule. /// Returns null when there was a load error; or when opening a netmodule.
/// </summary> /// </summary>
public async Task<AssemblyDefinition> GetAssemblyDefinitionAsync() public async Task<AssemblyDefinition> GetAssemblyDefinitionAsync()
{ {
var module = await assemblyTask; try {
return module != null ? module.Assembly : null; var module = await assemblyTask;
return module != null ? module.Assembly : null;
} catch {
return null;
}
} }
public AssemblyList AssemblyList => assemblyList; public AssemblyList AssemblyList => assemblyList;

Loading…
Cancel
Save