Update db.Utils.ListToDataTable

This commit is contained in:
sunkaixuan
2022-11-14 00:13:55 +08:00
parent 4e14a3d869
commit 9cfa813016

View File

@@ -764,7 +764,7 @@ namespace SqlSugar
public DataTable ListToDataTable<T>(List<T> 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)