Prevent AttributeError when closing HTTPClient early.
This commit is contained in:
parent
63c5892b43
commit
df130e10f0
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user