Safe convert current level

Dry startup can cause a crash if the field is somehow not filled in:

https://projectpokemon.org/home/forums/topic/46313-pkhex-ver-180716-wont-run/
This commit is contained in:
Kurt 2018-07-19 16:46:56 -07:00
parent 9a91619580
commit 229dc96c00

View file

@ -71,7 +71,7 @@ namespace PKHeX.WinForms.Controls
public bool FieldsInitialized { get; private set; }
public bool FieldsLoaded { get; private set; }
public bool ChangingFields { get; set; }
public int CurrentLevel => Convert.ToInt32((HaX ? MT_Level : TB_Level).Text);
public int CurrentLevel => Util.ToInt32((HaX ? MT_Level : TB_Level).Text);
private GameVersion origintrack;
private Action GetFieldsfromPKM;