NoneType check for module in should_log_sentry (#2139)

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. ( ͡ಠ ʖ̯ ͡ಠ)
This commit is contained in:
zephyrkul 2018-09-23 07:42:25 -06:00 committed by Toby Harradine
parent fc4703ef80
commit a3c36d4bde

View File

@ -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):