B2020-058: Null reference on procedure properties when procedure is an enhanced procedure

This commit is contained in:
Kathy Ruffing 2020-04-21 14:12:35 +00:00
parent 5fccf2f1d9
commit 99c68d0578

View File

@ -1693,7 +1693,8 @@ namespace Volian.Controls.Library
btnCpyStp.Enabled = setting;
//B20170-158 Allow a Unlinked Step to be pasted before or after a linked step.
StepTabPanel tmp = Parent as StepTabPanel;
if (tmp.MyDisplayTabControl.MyCopyStep != null)
//B2020-058: crash on null reference
if (tmp != null && tmp.MyDisplayTabControl != null && tmp.MyDisplayTabControl.MyCopyStep != null)
{
//B2017-180: The fix for B2017-158 also needed the 'HasEnhancedLinkedStep' to check if the copied step is a source step
if (!tmp.MyDisplayTabControl.MyCopyStep.IsEnhancedStep && !tmp.MyDisplayTabControl.MyCopyStep.HasEnhancedLinkedStep)