diff --git a/Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs b/Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs index 9bdf780fc..975f0aa97 100644 --- a/Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs +++ b/Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs @@ -155,6 +155,10 @@ namespace SqlSugar } public static bool IsIterator(this Type type) { + if (type.BaseType == null) + { + return false; + } if (type.BaseType.IsGenericType) { return type.BaseType?.GetGenericTypeDefinition()?.FullName == "System.Linq.Enumerable+Iterator`1";