mirror of https://github.com/Mai-with-u/MaiBot.git
fix(config): 添加对 identity_detail 字段的非空校验
- 在配置文件加载过程中,增加了对 [identity] 部分的 identity_detail 字段的非空检查 - 如果 identity_detail 为空字符串,将抛出 ValueError 异常pull/727/head
parent
7033f1dd1b
commit
0b7c17ef0f
|
|
@ -717,6 +717,10 @@ class BotConfig:
|
|||
logger.error(f"配置文件中缺少必需的字段: '{key}'")
|
||||
raise KeyError(f"配置文件中缺少必需的字段: '{key}'")
|
||||
|
||||
# identity_detail字段非空检查
|
||||
if not config.identity_detail:
|
||||
raise ValueError("配置文件错误:[identity] 部分的 identity_detail 不能为空字符串")
|
||||
|
||||
logger.success(f"成功加载配置文件: {config_path}")
|
||||
|
||||
return config
|
||||
|
|
|
|||
Loading…
Reference in New Issue