diff --git a/src/AddIns/Debugger/Debugger.AddIn/TreeModel/ArrayRangeNode.cs b/src/AddIns/Debugger/Debugger.AddIn/TreeModel/ArrayRangeNode.cs index e341b77e218..309071608c0 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/TreeModel/ArrayRangeNode.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/TreeModel/ArrayRangeNode.cs @@ -14,7 +14,7 @@ public partial class Utils public static IEnumerable LazyGetChildNodesOfArray(TreeNode parent, Expression expression, ArrayDimensions dimensions) { if (dimensions.TotalElementCount == 0) - return new TreeNode[] { new TreeNode(null, "(empty)", null, null, parent, null) }; + return new TreeNode[] { new TreeNode(null, "(empty)", null, null, parent, _ => null) }; return new ArrayRangeNode(parent, expression, dimensions, dimensions).ChildNodes; } diff --git a/src/AddIns/Debugger/Debugger.AddIn/TreeModel/ChildNodesOfObject.cs b/src/AddIns/Debugger/Debugger.AddIn/TreeModel/ChildNodesOfObject.cs index 2dcc2729634..7463c29caef 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/TreeModel/ChildNodesOfObject.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/TreeModel/ChildNodesOfObject.cs @@ -117,9 +117,9 @@ public static IEnumerable LazyGetItemsOfIList(TreeNode parent, Express error = e; } if (error != null) { - yield return new TreeNode(null, "(error)", error.Message, null, null, null); + yield return new TreeNode(null, "(error)", error.Message, null, null, _ => null); } else if (count == 0) { - yield return new TreeNode(null, "(empty)", null, null, null, null); + yield return new TreeNode(null, "(empty)", null, null, null, _ => null); } else { for(int i = 0; i < count; i++) { string imageName; diff --git a/src/AddIns/Debugger/Debugger.AddIn/TreeModel/TreeNode.cs b/src/AddIns/Debugger/Debugger.AddIn/TreeModel/TreeNode.cs index 451efe1c5a1..d00eb1df019 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/TreeModel/TreeNode.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/TreeModel/TreeNode.cs @@ -118,6 +118,8 @@ public TreeNode(TreeNode parent) public TreeNode(IImage iconImage, string name, string text, string type, TreeNode parent, Func> childNodes) : this(parent) { + if (childNodes == null) + throw new ArgumentNullException("childNodes"); this.iconImage = iconImage; this.name = name; this.text = text;