From 8b8057769a67c30a4c6101da95ce56b53d9fd484 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Thu, 30 Nov 2023 22:02:39 +0800 Subject: [PATCH] :bug: Fix load old player card info TypeError --- plugins/genshin/player_cards.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/genshin/player_cards.py b/plugins/genshin/player_cards.py index 8bcb7bd4..b68d554f 100644 --- a/plugins/genshin/player_cards.py +++ b/plugins/genshin/player_cards.py @@ -186,7 +186,9 @@ class PlayerCards(Plugin): await message.reply_text("未查询到您所绑定的账号信息,请先绑定账号", reply_markup=InlineKeyboardMarkup(buttons)) return original_data = await self._load_history(uid) - if original_data is None or len(original_data.get("avatarInfoList", [])) == 0: + if original_data and not original_data.get("avatarInfoList"): + original_data["avatarInfoList"] = [] + if original_data is None or len(original_data["avatarInfoList"]) == 0: if isinstance(self.kitsune, str): photo = self.kitsune else: