From 6225f660b57b2c848358c992f3ef45c0f13fdfae Mon Sep 17 00:00:00 2001 From: David_JonesDVN Date: Mon, 11 May 2020 19:56:46 +0430 Subject: [PATCH] Fix for empty thcrap directory setting. --- Touhou Launcher/MainForm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Touhou Launcher/MainForm.cs b/Touhou Launcher/MainForm.cs index 1157038..967cf02 100644 --- a/Touhou Launcher/MainForm.cs +++ b/Touhou Launcher/MainForm.cs @@ -996,7 +996,7 @@ private void Dir_LostFocus(object sender, EventArgs e) { ((TextBox)sender).BackColor = SystemColors.Window; curCfg.np2Dir = np2Dir.Text; - string crapPath = Path.GetDirectoryName(crapDir.Text); + string crapPath = crapDir.Text == "" ? "" : Path.GetDirectoryName(crapDir.Text); curCfg.crapDir = Directory.Exists(crapPath + "\\bin") ? crapPath : crapPath.TrimEnd("\\bin".ToCharArray()); curCfg.StartingRepo = crapStartingRepo.Text; }