handle empty stack in base_crash_handler

This commit is contained in:
Sander van Grieken
2023-02-01 10:42:49 +01:00
parent ca1edd1545
commit 9fd7bfd65c

View File

@@ -84,8 +84,8 @@ class BaseCrashReporter(Logger):
stack = traceback.extract_tb(self.exc_args[2])
readable_trace = self.__get_traceback_str_to_send()
id = {
"file": stack[-1].filename,
"name": stack[-1].name,
"file": stack[-1].filename if len(stack) else '<no stack>',
"name": stack[-1].name if len(stack) else '<no stack>',
"type": self.exc_args[0].__name__
}
return {