Filter out invalid types first

This commit is contained in:
Matt Nadareski
2025-09-20 16:55:54 -04:00
parent bd934c0af3
commit a85998ebf6

View File

@@ -131,6 +131,11 @@ namespace BinaryObjectScanner.Data
/// </summary>
private static List<T> InitCheckClasses<T>(Assembly assembly)
{
// Get information from the type param
string? interfaceName = typeof(T).FullName;
if (interfaceName == null)
return [];
// If not all types can be loaded, use the ones that could be
Type?[] assemblyTypes;
try
@@ -142,11 +147,6 @@ namespace BinaryObjectScanner.Data
assemblyTypes = rtle.Types ?? [];
}
// Get information from the type param
string? interfaceName = typeof(T).FullName;
if (interfaceName == null)
return [];
// Loop through all types
List<T> classTypes = [];
foreach (Type? type in assemblyTypes)