From 1c064bfe66e99f82c8543a047bb4e0f5f89ef20b Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Sat, 11 Apr 2026 07:41:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(config):=20=E8=A7=A3=E5=86=B3=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=88=97=E8=A1=A8=E5=8A=A0=E8=BD=BD=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加了 ListDirBegin 方法的错误检查 - 在遇到错误时返回 null 避免异常 - 确保目录遍历前检查操作状态 --- GFramework.Godot/Config/GodotYamlConfigLoader.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GFramework.Godot/Config/GodotYamlConfigLoader.cs b/GFramework.Godot/Config/GodotYamlConfigLoader.cs index 8e680600..217034fc 100644 --- a/GFramework.Godot/Config/GodotYamlConfigLoader.cs +++ b/GFramework.Godot/Config/GodotYamlConfigLoader.cs @@ -623,7 +623,12 @@ internal sealed class GodotYamlConfigEnvironment } var entries = new List(); - directory.ListDirBegin(); + var listDirectoryError = directory.ListDirBegin(); + if (listDirectoryError != Error.Ok) + { + return null; + } + while (true) { var name = directory.GetNext();