mirror of https://gitlab.com/litecord/litecord.git
storage: properly handle unknown channels on get_channel
This commit is contained in:
parent
7ac38212a3
commit
5bb9d107a6
|
|
@ -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 (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue