From c4c04d7e56599cf12b5af21264116cfab6f2e737 Mon Sep 17 00:00:00 2001 From: Syed Zaid Ali <65814383+i-am-zaidali@users.noreply.github.com> Date: Wed, 10 Jul 2024 04:19:27 +0500 Subject: [PATCH] fix for error about iterating over NoneType --- sharedcd/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sharedcd/main.py b/sharedcd/main.py index 40700f5..d7b11db 100644 --- a/sharedcd/main.py +++ b/sharedcd/main.py @@ -295,7 +295,7 @@ async def scd_e(self, ctx: commands.Context, id: str, *, flags: SCDFlagsAllOPT): lambda y: y[1] is not None, map( lambda x: (x, self.check_command_exists_as_scd(x)), - itertools.chain.from_iterable(flags._commands), + itertools.chain.from_iterable(flags._commands or []), ), ) ) @@ -306,7 +306,7 @@ async def scd_e(self, ctx: commands.Context, id: str, *, flags: SCDFlagsAllOPT): f"{cf.humanize_list(list(map(lambda x: f'`{x[0].qualified_name} (ID: {x[1].id})`', existing)))}" ) - if next(filter(lambda x: x.bot, itertools.chain.from_iterable(flags.bypass)), None): + if next(filter(lambda x: x.bot, itertools.chain.from_iterable(flags.bypass or [])), None): return await ctx.send( "Bots can not bypass SharedCooldowns since they can't run any commands in the first place." )