mirror of
https://github.com/zulip/zulip.git
synced 2026-07-15 21:03:26 +08:00
email_mirror: Fix exception for emails with no valid content type.
If a broken email shows up with no text or email content-type, we were attempting to return an undefined variable.
This commit is contained in:
parent
c7c533fd4d
commit
786b339b96
@ -215,8 +215,7 @@ def get_message_part_by_type(message, content_type):
|
||||
content = part.get_payload(decode=True)
|
||||
assert isinstance(content, binary_type)
|
||||
if charsets[idx]:
|
||||
text = content.decode(charsets[idx], errors="ignore")
|
||||
return text
|
||||
return content.decode(charsets[idx], errors="ignore")
|
||||
return None
|
||||
|
||||
def extract_body(message):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user