[commands] Fix crash when a group has no commands and help is requested

This commit is contained in:
Rapptz 2016-01-30 20:29:58 -05:00
parent 085e8d4eb3
commit 17e17cade9

View File

@ -104,7 +104,9 @@ class HelpFormatter:
the largest subcommand name."""
try:
commands = self.command.commands if not self.is_cog() else self.context.bot.commands
return max(map(lambda c: len(c.name), commands.values()))
if commands:
return max(map(lambda c: len(c.name), commands.values()))
return 0
except AttributeError:
return len(self.command.name)