Skip to content

Commit a78a55b

Browse files
perf: validate config_path before checking existence (#6722)
Add a check for empty config_path in check_exist method
1 parent 3148799 commit a78a55b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

astrbot/core/config/astrbot_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,6 @@ def __setattr__(self, key, value) -> None:
178178
self[key] = value
179179

180180
def check_exist(self) -> bool:
181+
if not self.config_path: # 加判空
182+
return False
181183
return os.path.exists(self.config_path)

0 commit comments

Comments
 (0)