aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-03-02 16:48:40 -0500
committerRapptz <[email protected]>2019-03-02 16:48:40 -0500
commitdf130e10f09ddb8fea3cc008ae310c75c214f9b3 (patch)
treec899ceb30d54040cab0a8364254de8a3a6272301
parentFix Signature for Greedy/Optional converters (diff)
downloaddiscord.py-df130e10f09ddb8fea3cc008ae310c75c214f9b3.tar.xz
discord.py-df130e10f09ddb8fea3cc008ae310c75c214f9b3.zip
Prevent AttributeError when closing HTTPClient early.
-rw-r--r--discord/http.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/discord/http.py b/discord/http.py
index 3fb13591..d098a0a4 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -230,7 +230,8 @@ class HTTPClient:
# state management
async def close(self):
- await self._session.close()
+ if self._session:
+ await self._session.close()
def _token(self, token, *, bot=True):
self.token = token