Merge pull request #1 from Avebluha/feature/save-dir-fix

Fixed error when save directory does not exist
This commit is contained in:
lewd-alt
2025-12-29 03:22:16 -06:00
committed by GitHub

View File

@@ -854,7 +854,13 @@ namespace SlaveMatrix
public static string[] SDPaths() public static string[] SDPaths()
{ {
IEnumerable<string> source = Directory.EnumerateFiles(SavePath); if (!Directory.Exists(SavePath))
{
Directory.CreateDirectory(SavePath);
}
IEnumerable<string> source = Directory.EnumerateFiles(SavePath);
return new string[10] return new string[10]
{ {
source.FirstOrDefault((string e) => e.StartsWith(Path.Combine(SavePath, "0 "))), source.FirstOrDefault((string e) => e.StartsWith(Path.Combine(SavePath, "0 "))),