From be7d6a38af7d106ef21de04b236595b9c24b56f1 Mon Sep 17 00:00:00 2001 From: Oleksandr Povar Date: Fri, 3 Sep 2021 11:29:10 +0200 Subject: [PATCH] Return valid modules only --- ILSpy/Analyzers/AnalyzerScope.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ILSpy/Analyzers/AnalyzerScope.cs b/ILSpy/Analyzers/AnalyzerScope.cs index f0f927dc0..4289b1810 100644 --- a/ILSpy/Analyzers/AnalyzerScope.cs +++ b/ILSpy/Analyzers/AnalyzerScope.cs @@ -77,7 +77,8 @@ namespace ICSharpCode.ILSpy.Analyzers public IEnumerable GetAllModules() { return AssemblyList.GetAllAssemblies().GetAwaiter().GetResult() - .Select(asm => asm.GetPEFileOrNull()); + .Select(asm => asm.GetPEFileOrNull()) + .Where(x => x != null); } public IEnumerable GetTypesInScope(CancellationToken ct)