From 2e1c0b9c4841d5a8be6cc72ce3a0bed792d12bb1 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 23 May 2017 08:28:53 -0700 Subject: [PATCH] misc loading fix gen1/2 games with new pkm editor no longer cause an exception on init load --- PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs index cd3ee1b43..c543e98eb 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs @@ -166,13 +166,11 @@ public void setPKMFormatMode(int Format) // Load Extra Byte List GB_ExtraBytes.Visible = GB_ExtraBytes.Enabled = extraBytes.Length != 0; + CB_ExtraBytes.Items.Clear(); + foreach (byte b in extraBytes) + CB_ExtraBytes.Items.Add($"0x{b:X2}"); if (GB_ExtraBytes.Enabled) - { - CB_ExtraBytes.Items.Clear(); - foreach (byte b in extraBytes) - CB_ExtraBytes.Items.Add($"0x{b:X2}"); CB_ExtraBytes.SelectedIndex = 0; - } } public void populateFields(PKM pk, bool focus = true) { @@ -1835,7 +1833,8 @@ public void TemplateFields(PKM template) { if (template != null) { populateFields(template); return; } - CB_GameOrigin.SelectedIndex = 0; + if (CB_GameOrigin.Items.Count > 0) + CB_GameOrigin.SelectedIndex = 0; CB_Move1.SelectedValue = 1; TB_OT.Text = "PKHeX"; TB_TID.Text = 12345.ToString();