Fix set import shortly after starting program

CB_Form is not yet initialized with items, do a little sanity checking
before setting index to 0.
Closes #729
This commit is contained in:
Kurt 2017-01-18 23:18:14 -08:00
parent e13b473979
commit ed52aa31e1

View file

@ -525,7 +525,7 @@ namespace PKHeX.WinForms
for (int i = 0; i < formStrings.Length; i++)
if (formStrings[i].Contains(Set.Form ?? ""))
{ form = i; break; }
CB_Form.SelectedIndex = form;
CB_Form.SelectedIndex = Math.Min(CB_Form.Items.Count-1, form);
// Set Ability
int[] abilities = SAV.Personal.getAbilities(Set.Species, form);