From 229dc96c007689abe94ccd0afdc76007cf69dc58 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 19 Jul 2018 16:46:56 -0700 Subject: [PATCH] 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/ --- PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs index 59117be6b..edad75889 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs @@ -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;