Browse Source

Merge pull request #2496 from zvirja/fix-null-module-enumeration

Fix attribute application analysis could fail if there are wrong assemblies loaded
pull/2431/head
Siegfried Pammer 4 years ago committed by GitHub
parent
commit
62e62233c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ILSpy/Analyzers/AnalyzerScope.cs

3
ILSpy/Analyzers/AnalyzerScope.cs

@ -77,7 +77,8 @@ namespace ICSharpCode.ILSpy.Analyzers
public IEnumerable<PEFile> GetAllModules() public IEnumerable<PEFile> GetAllModules()
{ {
return AssemblyList.GetAllAssemblies().GetAwaiter().GetResult() return AssemblyList.GetAllAssemblies().GetAwaiter().GetResult()
.Select(asm => asm.GetPEFileOrNull()); .Select(asm => asm.GetPEFileOrNull())
.Where(x => x != null);
} }
public IEnumerable<ITypeDefinition> GetTypesInScope(CancellationToken ct) public IEnumerable<ITypeDefinition> GetTypesInScope(CancellationToken ct)

Loading…
Cancel
Save