diff --git a/ILSpy/LoadedAssembly.cs b/ILSpy/LoadedAssembly.cs index 093912d0b..a3bf96f4c 100644 --- a/ILSpy/LoadedAssembly.cs +++ b/ILSpy/LoadedAssembly.cs @@ -67,7 +67,7 @@ namespace ICSharpCode.ILSpy /// /// Gets the Cecil ModuleDefinition. - /// Can be null when there was a load error. + /// Can return null when there was a load error. /// public Task GetModuleDefinitionAsync() { @@ -76,12 +76,16 @@ namespace ICSharpCode.ILSpy /// /// 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. /// public async Task GetAssemblyDefinitionAsync() { - var module = await assemblyTask; - return module != null ? module.Assembly : null; + try { + var module = await assemblyTask; + return module != null ? module.Assembly : null; + } catch { + return null; + } } public AssemblyList AssemblyList => assemblyList;