From a7f846b37fadbe21cc4a834359bbcbe9a76f2f0a Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 19 Jul 2017 05:14:23 -0400 Subject: [PATCH] [commands] Fix Command.root_parent not properly working. --- discord/ext/commands/core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index d7e562d5f..0f75d36a7 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