🐛 Fix KeyError when parse old gacha log data

This commit is contained in:
xtaodada 2024-03-13 16:29:58 +08:00
parent d83d55858b
commit 5a3989efb1
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -566,6 +566,8 @@ class GachaLog:
if not status: if not status:
raise GachaLogNotFound raise GachaLogNotFound
pool_name = GACHA_TYPE_LIST[pool] pool_name = GACHA_TYPE_LIST[pool]
if pool_name not in gacha_log.item_list:
raise GachaLogNotFound
data = gacha_log.item_list[pool_name] data = gacha_log.item_list[pool_name]
total = len(data) total = len(data)
if total == 0: if total == 0:
@ -614,6 +616,8 @@ class GachaLog:
if not status: if not status:
raise GachaLogNotFound raise GachaLogNotFound
pool_name = GACHA_TYPE_LIST[pool] pool_name = GACHA_TYPE_LIST[pool]
if pool_name not in gacha_log.item_list:
raise GachaLogNotFound
data = gacha_log.item_list[pool_name] data = gacha_log.item_list[pool_name]
total = len(data) total = len(data)
if total == 0: if total == 0: