handle header is None in get_header_unicode

This commit is contained in:
Son NK 2021-01-31 11:50:41 +01:00
parent 00fde00d53
commit 5f0930b291
1 changed files with 4 additions and 1 deletions

View File

@ -613,7 +613,10 @@ def get_spam_from_header(spam_status_header, max_score=None) -> (bool, str):
return spamassassin_answer.lower() == "yes", spam_status_header
def get_header_unicode(header: str):
def get_header_unicode(header: str) -> str:
if header is None:
return ""
decoded_string, charset = decode_header(header)[0]
if charset is not None:
try: