diff --git a/PROMS/Volian.Controls.Library/StepTabPanel.designer.cs b/PROMS/Volian.Controls.Library/StepTabPanel.designer.cs index 64545d37..682995a0 100644 --- a/PROMS/Volian.Controls.Library/StepTabPanel.designer.cs +++ b/PROMS/Volian.Controls.Library/StepTabPanel.designer.cs @@ -13,6 +13,10 @@ namespace Volian.Controls.Library /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { + // when a StepTabPanel is Disposed, if it was associated with the SelectedDisplayTabItem, set the SelectedDisplayTabItem to null + // this was causing an error where a deleted Procedure was being referenced, since it was the last SelectedDisplayTabItem + if (MyDisplayTabControl.SelectedDisplayTabItem != null && MyDisplayTabControl.SelectedDisplayTabItem.MyStepTabPanel == this) + MyDisplayTabControl.SelectedDisplayTabItem = null; if (disposing && (components != null)) { components.Dispose();