Skip to content

Commit d4ef8f5

Browse files
committed
Fix await player.get_club() error when the player is not part of a club
1 parent 2307dfc commit d4ef8f5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

brawlstats/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ def get_club(self) -> Club:
9494
A list of the members in a club, or None if the player is not in a club.
9595
"""
9696
if not self.club:
97+
if self.client.is_async:
98+
async def wrapper():
99+
return None
100+
return wrapper()
97101
return None
102+
98103
url = '{}/{}'.format(self.client.api.CLUB, bstag(self.club.tag))
99104
return self.client._get_model(url, model=Club)
100105

0 commit comments

Comments
 (0)