aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-02-14 12:23:59 -0800
committerGravatar MarkKoz <[email protected]>2020-02-14 12:23:59 -0800
commit9b6c9e8692313bd5ed70ce00c31e5b24e25635b1 (patch)
treea53c4ea0cac50674317c6ba6ce17861e77aec705
parentBot: add warning for when connector is a specified kwarg (diff)
Bot: fix error trying to close a None session
-rw-r--r--bot/bot.py4
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()