Skip to content

Commit 8a3e89f

Browse files
committed
BugFix - clans with null as a teamSize key trying to fetch war logs.
1 parent 3515cdc commit 8a3e89f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

coc/war_clans.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def _from_data(self, data: dict) -> None:
9494
self.max_stars = self._war.team_size * 3
9595
self.total_attacks = self._war.team_size * 2
9696
else:
97-
self.max_stars = data_get("teamSize", 0) * 3
98-
self.total_attacks = data_get("teamSize", 0) * 3
97+
self.max_stars = (data_get("teamSize") or 0) * 3
98+
self.total_attacks = (data_get("teamSize") or 0) * 3
9999

100100
self.__iter_members = (
101101
ClanWarMember(data=mdata, client=self._client, war=self._war, clan=self)

coc/wars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def _from_data(self, data: dict) -> None:
9090
data_get = data.get
9191

9292
self.state = data_get("state")
93-
self.team_size = data_get("teamSize", 0)
93+
self.team_size = data_get("teamSize") or 0
9494
self.preparation_start_time = try_enum(Timestamp, data=data_get("preparationStartTime"))
9595
self.start_time = try_enum(Timestamp, data=data_get("startTime"))
9696
self.end_time = try_enum(Timestamp, data=data_get("endTime"))

0 commit comments

Comments
 (0)