From 5bb9d107a6fa2edcc67a1e3a54f05a78f508300c Mon Sep 17 00:00:00 2001 From: Luna Date: Sun, 5 Sep 2021 23:30:55 -0300 Subject: [PATCH] storage: properly handle unknown channels on get_channel --- litecord/storage.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/litecord/storage.py b/litecord/storage.py index be70cd2..eca2481 100644 --- a/litecord/storage.py +++ b/litecord/storage.py @@ -532,6 +532,9 @@ class Storage: async def get_channel(self, channel_id: int, **kwargs) -> Optional[Dict[str, Any]]: """Fetch a single channel's information.""" chan_type = await self.get_chan_type(channel_id) + if chan_type is None: + return None + ctype = ChannelType(chan_type) if ctype in (