Skip to content

Commit

Permalink
fix: certain legends sometimes return empty values
Browse files Browse the repository at this point in the history
  • Loading branch information
chkpwd committed Feb 28, 2024
1 parent d803946 commit efd6391
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,12 @@ def populate_data(self):

# Data from Current Legend
self.current_legend_name = player_current_legend_data["LegendName"]
self.current_legend_br_kills = player_current_legend_data["data"][0]["value"]

# This data can sometimes return null
if not player_current_legend_data["data"]:
self.current_legend_br_kills = 0
else:
self.current_legend_br_kills = player_current_legend_data["data"][0]["value"]

# Data from All Legends
self.all_legends_kills = {}
Expand Down

0 comments on commit efd6391

Please sign in to comment.