From 5a3989efb178e04f579e0a11f5d883f0a132fb97 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Wed, 13 Mar 2024 16:29:58 +0800 Subject: [PATCH] :bug: Fix KeyError when parse old gacha log data --- modules/gacha_log/log.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/gacha_log/log.py b/modules/gacha_log/log.py index b5c80988..6cb88310 100644 --- a/modules/gacha_log/log.py +++ b/modules/gacha_log/log.py @@ -566,6 +566,8 @@ class GachaLog: if not status: raise GachaLogNotFound pool_name = GACHA_TYPE_LIST[pool] + if pool_name not in gacha_log.item_list: + raise GachaLogNotFound data = gacha_log.item_list[pool_name] total = len(data) if total == 0: @@ -614,6 +616,8 @@ class GachaLog: if not status: raise GachaLogNotFound pool_name = GACHA_TYPE_LIST[pool] + if pool_name not in gacha_log.item_list: + raise GachaLogNotFound data = gacha_log.item_list[pool_name] total = len(data) if total == 0: