Skip to content

Commit 1fa1188

Browse files
authored
fix: autodefer erroring when *args is empty (#1103)
1 parent 8ae7706 commit 1fa1188

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

interactions/utils/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,12 @@ async def deferring_func(
7878
except RuntimeError as e:
7979
raise RuntimeError("No running event loop detected!") from e
8080

81-
if isinstance(args[0], (ComponentContext, CommandContext)):
81+
if args and isinstance(args[0], (ComponentContext, CommandContext)):
8282
self = ctx
8383
args = list(args)
8484
ctx = args.pop(0)
8585

8686
task: Task = loop.create_task(coro(self, ctx, *args, **kwargs))
87-
8887
else:
8988
task: Task = loop.create_task(coro(ctx, *args, **kwargs))
9089

0 commit comments

Comments
 (0)