storage: properly handle unknown channels on get_channel

This commit is contained in:
Luna 2021-09-05 23:30:55 -03:00
parent 7ac38212a3
commit 5bb9d107a6
1 changed files with 3 additions and 0 deletions

View File

@ -532,6 +532,9 @@ class Storage:
async def get_channel(self, channel_id: int, **kwargs) -> Optional[Dict[str, Any]]: async def get_channel(self, channel_id: int, **kwargs) -> Optional[Dict[str, Any]]:
"""Fetch a single channel's information.""" """Fetch a single channel's information."""
chan_type = await self.get_chan_type(channel_id) chan_type = await self.get_chan_type(channel_id)
if chan_type is None:
return None
ctype = ChannelType(chan_type) ctype = ChannelType(chan_type)
if ctype in ( if ctype in (