Verify that the current node is within range before looking at the value
This commit is contained in:
parent
f8c047e0c7
commit
94a1c4289b
@ -2050,7 +2050,7 @@ namespace Volian.Controls.Library
|
|||||||
if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK)
|
if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK)
|
||||||
{
|
{
|
||||||
int indx = tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1);
|
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);
|
tn = new VETreeNode(_LastSectionInfo);
|
||||||
par.Nodes.Insert(indx, tn);
|
par.Nodes.Insert(indx, tn);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user