fix(pairing): treat null approved channel lists as empty

pairing.json with "telegram": null crashed is_approved during load.
Treat non-list channel entries as an empty allow-list.
This commit is contained in:
santhreal
2026-07-23 14:04:53 +08:00
committed by chengyongru
parent 5851bd432a
commit 0191c0db73
2 changed files with 19 additions and 0 deletions
+2
View File
@@ -46,6 +46,8 @@ def _load() -> dict[str, Any]:
# Convert approved lists to str sets for O(1) lookup.
for channel, users in data.get("approved", {}).items():
if not isinstance(users, list):
users = []
data["approved"][channel] = {str(u) for u in users}
return data