From 9cfa813016f7f6791f971d09f9f8907cc649544d Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 14 Nov 2022 00:13:55 +0800 Subject: [PATCH] Update db.Utils.ListToDataTable --- Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs index 643da1ce7..853901561 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs @@ -764,7 +764,7 @@ namespace SqlSugar public DataTable ListToDataTable(List list) { DataTable result = new DataTable(); - if (list.Count > 0) + if (list!=null&&list.Count > 0) { PropertyInfo[] propertys = list[0].GetType().GetProperties(); foreach (PropertyInfo pi in propertys)