diff --git a/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs b/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs index da4408f2..cc293a38 100644 --- a/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs +++ b/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs @@ -341,11 +341,13 @@ namespace VEPROMS.CSLA.Library } void myItemInfo_NewSiblingBefore(object sender, ItemInfoInsertEventArgs args) { - this.Parent.Nodes.Insert(Index,(new VETreeNode(args.ItemInserted))); + if(this.Parent != null) // Only do this if the node has a parent - RHM 20100106 + this.Parent.Nodes.Insert(Index,(new VETreeNode(args.ItemInserted))); } void myItemInfo_NewSiblingAfter(object sender, ItemInfoInsertEventArgs args) { - this.Parent.Nodes.Insert(Index+1, (new VETreeNode(args.ItemInserted))); + if (this.Parent != null) // Only do this if the node has a parent - RHM 20100106 + this.Parent.Nodes.Insert(Index + 1, (new VETreeNode(args.ItemInserted))); } void MyContent_Changed(object sender) {