Skip to content

Commit a85998e

Browse files
committed
Filter out invalid types first
1 parent bd934c0 commit a85998e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

BinaryObjectScanner/Data/StaticChecks.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ public static List<IExecutableCheck<PortableExecutable>> PortableExecutableCheck
131131
/// </summary>
132132
private static List<T> InitCheckClasses<T>(Assembly assembly)
133133
{
134+
// Get information from the type param
135+
string? interfaceName = typeof(T).FullName;
136+
if (interfaceName == null)
137+
return [];
138+
134139
// If not all types can be loaded, use the ones that could be
135140
Type?[] assemblyTypes;
136141
try
@@ -142,11 +147,6 @@ private static List<T> InitCheckClasses<T>(Assembly assembly)
142147
assemblyTypes = rtle.Types ?? [];
143148
}
144149

145-
// Get information from the type param
146-
string? interfaceName = typeof(T).FullName;
147-
if (interfaceName == null)
148-
return [];
149-
150150
// Loop through all types
151151
List<T> classTypes = [];
152152
foreach (Type? type in assemblyTypes)

0 commit comments

Comments
 (0)