Corrected issue where having no server alerts set broke the loop
This commit is contained in:
parent
2d3e5d680c
commit
2e4f006f5f
|
@ -97,7 +97,7 @@ class Picarto:
|
|||
server_alerts = await utils.get_content('server_alerts', {'server_id': server_id})
|
||||
try:
|
||||
channel_id = server_alerts[0]['channel_id']
|
||||
except IndexError:
|
||||
except (IndexError, TypeError):
|
||||
channel_id = server_id
|
||||
channel = self.bot.get_channel(channel_id)
|
||||
# Get the member that has just gone live
|
||||
|
|
|
@ -89,7 +89,7 @@ class Twitch:
|
|||
continue
|
||||
server_alerts = await utils.get_content('server_alerts', {'server_id': server_id})
|
||||
channel_id = server_id
|
||||
if len(server_alerts) > 0:
|
||||
if server_alerts is not None and len(server_alerts) > 0:
|
||||
channel_id = server_alerts[0].get('channel_id')
|
||||
channel = self.bot.get_channel(channel_id)
|
||||
# Get the member that has just gone live
|
||||
|
|
Loading…
Reference in a new issue