From f075e4d40432a4c33fc2f4857145854eeaf8429b Mon Sep 17 00:00:00 2001 From: Xie Zhihao Date: Tue, 19 Mar 2024 08:24:04 +0800 Subject: [PATCH] Fix uninitialized variables in posting battle result with empty overview data --- s3s.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/s3s.py b/s3s.py index ccaa5a7..0ceffb3 100755 --- a/s3s.py +++ b/s3s.py @@ -679,6 +679,7 @@ def prepare_battle_result(battle, ismonitoring, isblackout, overview_data=None): overview_data = None print("Failed to get recent Anarchy Battles. Proceeding without information on current rank.") if overview_data is not None: + ranked_list = [] for screen in overview_data: if "bankaraBattleHistories" in screen["data"]: ranked_list = screen["data"]["bankaraBattleHistories"]["historyGroups"]["nodes"] @@ -766,6 +767,7 @@ def prepare_battle_result(battle, ismonitoring, isblackout, overview_data=None): overview_data = None print("Failed to get recent X Battles. Proceeding without some information on X Power.") if overview_data is not None: + x_list = [] for screen in overview_data: if "xBattleHistories" in screen["data"]: x_list = screen["data"]["xBattleHistories"]["historyGroups"]["nodes"]