channels: handle when chan_type is None

This commit is contained in:
Luna 2021-09-05 23:28:54 -03:00
parent 948627efd1
commit 9d81bef527
1 changed files with 3 additions and 0 deletions

View File

@ -194,6 +194,9 @@ async def close_channel(channel_id):
user_id = await token_check() user_id = await token_check()
chan_type = await app.storage.get_chan_type(channel_id) chan_type = await app.storage.get_chan_type(channel_id)
if chan_type is None:
raise ChannelNotFound("Channel not found")
ctype = ChannelType(chan_type) ctype = ChannelType(chan_type)
if ctype in GUILD_CHANS: if ctype in GUILD_CHANS: