diff options
| author | Rapptz <[email protected]> | 2019-03-02 16:48:40 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-03-02 16:48:40 -0500 |
| commit | df130e10f09ddb8fea3cc008ae310c75c214f9b3 (patch) | |
| tree | c899ceb30d54040cab0a8364254de8a3a6272301 | |
| parent | Fix Signature for Greedy/Optional converters (diff) | |
| download | discord.py-df130e10f09ddb8fea3cc008ae310c75c214f9b3.tar.xz discord.py-df130e10f09ddb8fea3cc008ae310c75c214f9b3.zip | |
Prevent AttributeError when closing HTTPClient early.
| -rw-r--r-- | discord/http.py | 3 |
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 |