diff options
| author | 2020-02-14 12:23:59 -0800 | |
|---|---|---|
| committer | 2020-02-14 12:23:59 -0800 | |
| commit | 9b6c9e8692313bd5ed70ce00c31e5b24e25635b1 (patch) | |
| tree | a53c4ea0cac50674317c6ba6ce17861e77aec705 | |
| parent | Bot: add warning for when connector is a specified kwarg (diff) | |
Bot: fix error trying to close a None session
| -rw-r--r-- | bot/bot.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/bot.py b/bot/bot.py index 762d316bf..67a15faba 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -44,9 +44,11 @@ class Bot(commands.Bot): """Close the Discord connection and the aiohttp session, connector, and resolver.""" await super().close() - await self.http_session.close() await self.api_client.close() + if self.http_session: + await self.http_session.close() + if self._connector: await self._connector.close() |