From a3c36d4bde4dd4a8ea91887c3b3667b7d588235d Mon Sep 17 00:00:00 2001 From: zephyrkul Date: Sun, 23 Sep 2018 07:42:25 -0600 Subject: [PATCH] NoneType check for module in should_log_sentry (#2139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows for a lack of module (which returns False) for `should_log_sentry`. This allows for, say, commands to be added by the Dev cog. ( ͡ಠ ʖ̯ ͡ಠ) --- redbot/core/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redbot/core/events.py b/redbot/core/events.py index 8d8480ba0..fa90a7c0e 100644 --- a/redbot/core/events.py +++ b/redbot/core/events.py @@ -43,7 +43,7 @@ def should_log_sentry(exception) -> bool: tb = tb.tb_next module = tb_frame.f_globals.get("__name__") - return module.startswith("redbot") + return module is not None and module.startswith("redbot") def init_events(bot, cli_flags):