From a78a55bcc0debd24dc9fc6d98ee5d7ebe72cfdcc Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Mon, 23 Mar 2026 19:04:07 +0800 Subject: [PATCH] perf: validate config_path before checking existence (#6722) Add a check for empty config_path in check_exist method --- astrbot/core/config/astrbot_config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/astrbot/core/config/astrbot_config.py b/astrbot/core/config/astrbot_config.py index 6a415e56c..77c298cac 100644 --- a/astrbot/core/config/astrbot_config.py +++ b/astrbot/core/config/astrbot_config.py @@ -178,4 +178,6 @@ class AstrBotConfig(dict): self[key] = value def check_exist(self) -> bool: + if not self.config_path: # 加判空 + return False return os.path.exists(self.config_path)