From 8b389f97271e6b96f812e5b969428db617cba565 Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 18 Mar 2020 13:14:09 +0000 Subject: [PATCH] B2020-039: Fix crash on save of Word selection (invalid selectedindex used) --- PROMS/VEPROMS User Interface/frmSectionProperties.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index 7e550cda..18d658b5 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -122,8 +122,9 @@ namespace VEPROMS 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; // C2020-003 use the _CheckOffIndex dictionary to get and save the index of the selected checkoff from the sorted checkoff list + // B2020-039: Added the check for a valid selected index so that crash doesn't occur if (ppGpbxSignoffCheckoff.Enabled && (chkoffList != null && maxindx > 1) - && (_CheckOffIndex[ppCmbxCheckoffType.SelectedIndex] != _SectionConfig.Section_CheckoffListSelection)) + && (ppCmbxCheckoffType.SelectedIndex > -1 && _CheckOffIndex[ppCmbxCheckoffType.SelectedIndex] != _SectionConfig.Section_CheckoffListSelection)) _SectionConfig.Section_CheckoffListSelection = _CheckOffIndex[ppCmbxCheckoffType.SelectedIndex]; if (ppCmbxCheckoffHeading.Enabled && chkoffHeaderList != null && chkoffHeaderList.MaxIndexNoInherit > 1) _SectionConfig.Section_CheckoffHeaderSelection = ppCmbxCheckoffHeading.SelectedIndex;