From 52efacacd7b6dace838eb15ef9013d6202917fc4 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Mon, 5 Jun 2023 01:31:08 +0200 Subject: [PATCH] Fix issue with trimmed folder names being empty. --- Penumbra/Mods/ModCreator.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Penumbra/Mods/ModCreator.cs b/Penumbra/Mods/ModCreator.cs index 755caeb3..5d37e99e 100644 --- a/Penumbra/Mods/ModCreator.cs +++ b/Penumbra/Mods/ModCreator.cs @@ -332,7 +332,10 @@ public partial class ModCreator /// Return the name of a new valid directory based on the base directory and the given name. public static DirectoryInfo NewOptionDirectory(DirectoryInfo baseDir, string optionName) - => new(Path.Combine(baseDir.FullName, ReplaceBadXivSymbols(optionName))); + { + var option = ReplaceBadXivSymbols(optionName); + return new DirectoryInfo(Path.Combine(baseDir.FullName, option.Length > 0 ? option : "_")); + } /// Normalize for nicer names, and remove invalid symbols or invalid paths. public static string ReplaceBadXivSymbols(string s, string replacement = "_")