Fixed error when save directory does not exist

This commit is contained in:
AbdulmanovAI
2025-10-23 12:39:39 +04:00
parent 926794af44
commit 4d6aee63fb

View File

@@ -854,7 +854,13 @@ namespace SlaveMatrix
public static string[] SDPaths() public static string[] SDPaths()
{ {
if (!Directory.Exists(SavePath))
{
Directory.CreateDirectory(SavePath);
}
IEnumerable<string> source = Directory.EnumerateFiles(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 "))),