From 2bc4a8d105205bc5edf87e1822e85220536c2b90 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 21 Jan 2020 17:48:16 +0000 Subject: [PATCH] B2020-009 Copy/Paste procedures, check for background step editor sections (being copied) that are empty (contains no steps) and skip the process that tries to create links for these (non-existing) steps --- PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 67195d42..5ce1cefa 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -1469,9 +1469,13 @@ namespace VEPROMS.CSLA.Library if (ed.Type == enhType) { newEnhSectionInfo = ItemInfo.Get(ed.ItemID); - StepConfig cfg = newEnhSectionInfo.Steps[0].MyConfig as StepConfig; - if (cfg.MyEnhancedDocuments.Count > 0) enhStep = newEnhSectionInfo.Steps[0]; - else enhStep = GetNextEnhancedStep(newEnhSectionInfo.Steps[0]); + // B2020-009 if section does not have steps (empty step section) then skip it. + if (newEnhSectionInfo.Steps != null) + { + StepConfig cfg = newEnhSectionInfo.Steps[0].MyConfig as StepConfig; + if (cfg.MyEnhancedDocuments.Count > 0) enhStep = newEnhSectionInfo.Steps[0]; + else enhStep = GetNextEnhancedStep(newEnhSectionInfo.Steps[0]); + } break; } }