fix use before init

This commit is contained in:
Kurt 2018-11-26 19:06:51 -08:00
parent 76a2e4f527
commit 08f13cb3a1

View file

@ -8,7 +8,13 @@ namespace PKHeX.WinForms.Controls
{
private PB7 pkm;
private bool Loading;
public SizeCP() => InitializeComponent();
public SizeCP()
{
InitializeComponent();
Initialized = true;
}
private readonly bool Initialized;
public void LoadPKM(PKM pk)
{
@ -20,6 +26,8 @@ namespace PKHeX.WinForms.Controls
public void TryResetStats()
{
if (!Initialized || pkm == null)
return;
if (CHK_Auto.Checked)
pkm.ResetCalculatedValues();
LoadStoredValues();