aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-09-14 17:00:28 -0700
committerGravatar MarkKoz <[email protected]>2019-09-14 19:05:43 -0700
commitd1626f6263d40acca8a80257ba085107c6c8633a (patch)
tree2d1236a7d9354c866146c40d84da0a140e770b77
parentFix deleting already deleted message in antispam (diff)
Actually fix cog error handler check when command is None
-rw-r--r--bot/cogs/error_handler.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/cogs/error_handler.py b/bot/cogs/error_handler.py
index 994950c84..1f0700f28 100644
--- a/bot/cogs/error_handler.py
+++ b/bot/cogs/error_handler.py
@@ -43,7 +43,8 @@ class ErrorHandler:
else:
help_command = (self.bot.get_command("help"),)
- if hasattr(command, "on_error") or hasattr(ctx.cog, f"_{command.cog_name}__error"):
+ cog_has_handler = command and hasattr(ctx.cog, f"_{command.cog_name}__error")
+ if hasattr(command, "on_error") or cog_has_handler:
log.debug(f"Command {command} has a local error handler; ignoring.")
return