Check for a bad number in the step config for the checkoff value. If the value is invalid, then default to the first item in the checkoff list.
This commit is contained in:
		@@ -240,7 +240,11 @@ namespace Volian.Controls.Library
 | 
				
			|||||||
				{
 | 
									{
 | 
				
			||||||
					cmbCheckoff.Items.Add(co.MenuItem);
 | 
										cmbCheckoff.Items.Add(co.MenuItem);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				if (sc.Step_CheckOffIndex != -1) cmbCheckoff.SelectedIndex = sc.Step_CheckOffIndex;
 | 
									// bug fix B2015-186
 | 
				
			||||||
 | 
									// the config had a really big number for the checkoff index.
 | 
				
			||||||
 | 
									// if that config number is greater than the number of items in the checkoff list, default to an index of zero
 | 
				
			||||||
 | 
									if (sc.Step_CheckOffIndex != -1)
 | 
				
			||||||
 | 
										cmbCheckoff.SelectedIndex = (sc.Step_CheckOffIndex <= cmbCheckoff.Items.Count - 1) ? sc.Step_CheckOffIndex : 0;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			// if there are no checkoffs OR
 | 
								// if there are no checkoffs OR
 | 
				
			||||||
			// if this is a sign-off, the checkoff list is not enabled either (matches 16bit functionality) At some point, we
 | 
								// if this is a sign-off, the checkoff list is not enabled either (matches 16bit functionality) At some point, we
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user