diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index a35db2d7..8f5048be 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -706,20 +706,32 @@ namespace VEPROMS CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList; CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList; int maxindx = pf.FormatData.ProcData.CheckOffUCF ? pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndex : pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit; + // B2019-013: was crashing on indexer of checkofflist. If there were UCF checkoffs but none in original format, the indexer + // was failing for index of 0 (indexer code went through index attribute of xml and was returning null even though there + // were items in list). + _hasSectionCheckoffDefault = false; + if (chkoffList != null) + { + foreach (CheckOff co in chkoffList) + { + if (co.MenuItem.ToUpper().Equals("{SECTION DEFAULT}")) + { + _hasSectionCheckoffDefault = true; + break; + } + } + } if (chkoffList != null && maxindx > 0 && - (pf.FormatData.ProcData.CheckOffData.Menu == "Signoff" || chkoffList[0].MenuItem.ToUpper().Equals("{SECTION DEFAULT}"))) + (pf.FormatData.ProcData.CheckOffData.Menu == "Signoff") || _hasSectionCheckoffDefault) { if (SectionPropertyCheckOffList!=null)SectionPropertyCheckOffList.Clear(); SectionPropertyCheckOffList = new List(); // Don't put up the first item in the chkoffList, it is '{Section Default}'. - _hasSectionCheckoffDefault = false; //for (int i = 1; i < chkoffList.Count; i++) foreach (CheckOff co in chkoffList) { if (!co.MenuItem.ToUpper().Equals("{SECTION DEFAULT}")) SectionPropertyCheckOffList.Add(co); - else - _hasSectionCheckoffDefault = true; } ppGpbxSignoffCheckoff.Enabled = true; ppCmbxCheckoffType.DataSource = SectionPropertyCheckOffList;