Skip to content

Commit

Permalink
config: fix getter attempting to access NoneType attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
seven7ty committed Feb 9, 2022
1 parent 57a9d15 commit f04f475
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cogs/ecosystem/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ async def feed_channel_command(self, ctx: GitBotContext, channel) -> None:
except commands.BadArgument:
await ctx.error(ctx.l.config.feed.channel.invalid_channel)
return
guild: dict = await Mgr.db.guilds.find_one({'_id': ctx.guild.id})
feed: dict = guild.get('feed', {})
guild: Optional[GitBotGuild] = await Mgr.db.guilds.find_one({'_id': ctx.guild.id})
success: bool = False
if guild:
feed: dict = guild.get('feed', {})
if len(feed) >= 5:
embed_limit_reached: discord.Embed = discord.Embed(
color=Mgr.c.discord.yellow,
Expand Down

0 comments on commit f04f475

Please sign in to comment.