aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/ext/commands/core.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index d7e562d5..0f75d36a 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -305,8 +305,10 @@ class Command:
while command.parent is not None:
command = command.parent
entries.append(command)
- entries.append(None)
- entries.reverse()
+
+ if len(entries) == 0:
+ return None
+
return entries[-1]
@property