From 94a1c4289ba8f72fb9a546b0a0b39db53e695173 Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 5 Aug 2015 12:38:40 +0000 Subject: [PATCH] Verify that the current node is within range before looking at the value --- PROMS/Volian.Controls.Library/vlnTreeView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index e45f5a76..eb1a4aca 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -2050,7 +2050,7 @@ namespace Volian.Controls.Library if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK) { int indx = tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1); - if ((par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString()) + if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString()) { tn = new VETreeNode(_LastSectionInfo); par.Nodes.Insert(indx, tn);