用户名空白检测+修复一重大bug

This commit is contained in:
2026-02-24 20:09:10 +08:00
parent 0386511a00
commit e0e7da7ac2
5 changed files with 31 additions and 20 deletions

View File

@@ -47,15 +47,22 @@ namespace CMLeonOS
if (value != null && fileSystem != null)
{
string fullPath = fileSystem.GetFullPath(value);
if (System.IO.File.Exists(fullPath))
try
{
string fullPath = fileSystem.GetFullPath(value);
string text = fileSystem.ReadFile(fullPath);
text = text.Replace("\r\n", "\n");
lines.AddRange(text.Split('\n'));
if (!string.IsNullOrEmpty(text))
{
text = text.Replace("\r\n", "\n");
lines.AddRange(text.Split('\n'));
}
else
{
lines.Add(string.Empty);
}
}
else
catch
{
lines.Add(string.Empty);
}