From 9e83eaa7da739146a68aaad5403f2590735f5656 Mon Sep 17 00:00:00 2001 From: MingboPeng Date: Fri, 22 Sep 2023 11:45:43 +0800 Subject: [PATCH] fix(Duplicate): improve duplicating null child objects --- src/Ironbug.HVAC/BaseClass/IB_ModelObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ironbug.HVAC/BaseClass/IB_ModelObject.cs b/src/Ironbug.HVAC/BaseClass/IB_ModelObject.cs index 7072aa5d..7d3110da 100644 --- a/src/Ironbug.HVAC/BaseClass/IB_ModelObject.cs +++ b/src/Ironbug.HVAC/BaseClass/IB_ModelObject.cs @@ -508,7 +508,7 @@ protected T Duplicate(Func func) where T : IB_ModelObject newObj.Children.Clear(); foreach (var child in this.Children) { - newObj.Children.Add(child.Duplicate()); + newObj.Children.Add(child?.Duplicate()); } newObj.IBProperties = this.IBProperties.Duplicate();