Prevent AttributeError when closing HTTPClient early.

This commit is contained in:
Rapptz 2019-03-02 16:48:40 -05:00
parent 63c5892b43
commit df130e10f0

View File

@ -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