Skip to content

Commit 02c66d6

Browse files
committed
:bug 修复部分错误
1 parent c2c0502 commit 02c66d6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

nonebot_plugin_l4d2_server/__main__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
from nonebot.plugin import on_command
2929
from nonebot_plugin_alconna import UniMessage
3030

31-
from nonebot_plugin_l4d2_server.l4_ban.utils import refresh_server_command_rule
32-
3331
from .config import config, config_manager
3432
from .l4_ban import l4_request
33+
from .l4_ban.utils import refresh_server_command_rule
3534
from .l4_help import get_l4d2_core_help
3635
from .l4_local import * # noqa: F403
3736
from .l4_request import (

nonebot_plugin_l4d2_server/l4_request/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ def reload_ip():
108108
COMMAND.clear()
109109
for item in server_all_path.iterdir():
110110
if item.is_file() and item.name.endswith("json"):
111-
json_data = json.loads(item.read_text(encoding="utf-8"))
111+
try:
112+
json_data = json.loads(item.read_text(encoding="utf-8"))
113+
except json.JSONDecodeError:
114+
continue
112115
group_server = cast(Dict[str, List[NserverOut]], json_data)
113116

114117
for group, group_ip in group_server.items():

0 commit comments

Comments
 (0)