From 82a35bd8b500b3bd0c54014c7d6aa49683ee55c4 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Fri, 11 Nov 2022 11:02:12 +0800 Subject: [PATCH] Update InsertNav many to many --- .../ExecuteNavProvider/InsertNavProviderManyToMany.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/InsertNavProviderManyToMany.cs b/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/InsertNavProviderManyToMany.cs index 308b8a892..ee9dbc696 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/InsertNavProviderManyToMany.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/InsertNavProviderManyToMany.cs @@ -38,6 +38,10 @@ namespace SqlSugar foreach (var item in parentList) { var items= parentNavigateProperty.PropertyInfo.GetValue(item); + if (items == null) + { + continue; + } var children=((List)items); InsertDatas(children, thisPkColumn); var parentId = parentPkColumn.PropertyInfo.GetValue(item);