diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs index 5ec9a5a98..480feee40 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs @@ -439,7 +439,7 @@ namespace SqlSugar private Dictionary DataReaderToList(IDataReader reader, Type tType, List classProperties, List reval) { var readerValues = DataReaderToDictionary(reader, tType); - var mappingKeys = this.QueryBuilder.MappingKeys; + var mappingKeys = this.QueryBuilder?.MappingKeys; var result = new Dictionary(); foreach (var item in classProperties) {