aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-04-14 20:38:13 -0400
committerRapptz <[email protected]>2016-04-14 20:38:13 -0400
commit03862a71453c1e8c8d5fed18dc87ddd3ad04d16f (patch)
tree845e14760fe0d37a2edad404b738646e47b54e16
parentRetry if send_message or edit_message encounter a 502. (diff)
downloaddiscord.py-03862a71453c1e8c8d5fed18dc87ddd3ad04d16f.tar.xz
discord.py-03862a71453c1e8c8d5fed18dc87ddd3ad04d16f.zip
Add a None check when setting status in Client.change_status.
-rw-r--r--discord/client.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py
index e8987baa..c359509a 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -1587,9 +1587,13 @@ class Client:
log.debug('Sending "{}" to change status'.format(sent))
yield from self._send_ws(sent)
for server in self.servers:
- server.me.game = game
+ me = server.me
+ if me is None:
+ continue
+
+ me.game = game
status = Status.idle if idle_since else Status.online
- server.me.status = status
+ me.status = status
# Channel management