🐛 Fix abyss floor IndexError

This commit is contained in:
xtaodada 2023-08-02 15:18:11 +08:00
parent 89d9d2f49c
commit af2e9bdb9b
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -311,7 +311,7 @@ class AbyssPlugin(Plugin):
else:
render_data["floor-num"] = f"{num_dic.get(str(floor % 10))}"
floors = jsonlib.loads(result)["floors"]
if (floor_data := list(filter(lambda x: x["floor"] == floor, floors))) is None:
if not (floor_data := list(filter(lambda x: x["floor"] == floor, floors))):
return None
avatars = await client.get_genshin_characters(uid, lang="zh-cn")
render_data["avatar_data"] = {i.id: i.constellation for i in avatars}