From 63242cc24dcb0c6d42af0b317ff42e7d2f86c006 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 25 Jul 2018 07:26:29 -0700 Subject: [PATCH] Reorder open folder logic Close() still finished executing the method Closes #2076 --- PKHeX.WinForms/Subforms/SAV_FolderList.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PKHeX.WinForms/Subforms/SAV_FolderList.cs b/PKHeX.WinForms/Subforms/SAV_FolderList.cs index 883115c65..9a6729c21 100644 --- a/PKHeX.WinForms/Subforms/SAV_FolderList.cs +++ b/PKHeX.WinForms/Subforms/SAV_FolderList.cs @@ -104,12 +104,13 @@ private void AddButton(string name, string path) button.Enabled = new DirectoryInfo(path).Exists; button.Click += (s, e) => { - if (Directory.Exists(path)) + if (!Directory.Exists(path)) { - Process.Start("explorer.exe", path); - Close(); + WinFormsUtil.Alert(MsgFolderNotFound, path); + return; } - WinFormsUtil.Alert(MsgFolderNotFound, path); + Process.Start("explorer.exe", path); + Close(); }; FLP_Buttons.Controls.Add(button); }