diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index e153e7fa..9d9cef70 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -57,7 +57,14 @@ namespace VEPROMS } else // Step Tab Panel { - SelectedDVI = value.MyStepPanel.MyProcedureItemInfo.MyProcedure.ActiveParent as DocVersionInfo; + // The following line was broken into separate lines because a NullReferenceError was occuring. + // Now we should be able to tell what is wrong by which line causes the Null Reference Error + // RHM 20101217 + //SelectedDVI = value.MyStepPanel.MyProcedureItemInfo.MyProcedure.ActiveParent as DocVersionInfo; + StepPanel stepPanel = value.MyStepPanel; + ItemInfo itemInfo = stepPanel.MyProcedureItemInfo; + ProcedureInfo procedureInfo = itemInfo.MyProcedure; + SelectedDVI = procedureInfo.ActiveParent as DocVersionInfo; // Remove it first, if it wasn't set, this doesn't do anything, but if it was set, you don't want // multiple events because the print dialog will be displayed for each time the event was added. _SelectedStepTabPanel.MyStepTabRibbon.PrintRequest -= new StepTabRibbonEvent(MyStepTabRibbon_PrintRequest); diff --git a/PROMS/Volian.Controls.Library/StepItem.cs b/PROMS/Volian.Controls.Library/StepItem.cs index 2391e87b..f908a4fc 100644 --- a/PROMS/Volian.Controls.Library/StepItem.cs +++ b/PROMS/Volian.Controls.Library/StepItem.cs @@ -2161,8 +2161,16 @@ namespace Volian.Controls.Library /// public void ItemSelect() { - _MyStepRTB.Focus(); - _MyStepRTB.Select(0, 0); + // Was getting an Error that _MyStepRTB was Disposed RHM 20101217 + if (!_MyStepRTB.Disposing) + { + _MyStepRTB.Focus(); + _MyStepRTB.Select(0, 0); + } + else + { + _MyLog.WarnFormat("Attempt to give Focus to Disposed Object {0}", MyID); + } // if (CanExpand) AutoExpand(); // Expand the item if you can ScrollToCenter(); }