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; } }