Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions extract_msg/contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,13 @@ def headerFormatProperties(self) -> constants.HEADER_FORMAT_TYPE:
If you class should not do *any* header injection, return None from this
property.
"""
def strListToStr(inp : Union[str, List[str]]):
def strListToStr(inp : Union[str, None, List[str]]):
"""
Small internal function for things that may return a string or list.
"""
if isinstance(inp, str):
if inp is None:
return None
elif isinstance(inp, str):
return inp
else:
return ', '.join(inp)
Expand Down Expand Up @@ -750,7 +752,7 @@ def strListToStr(inp : Union[str, List[str]]):
'Anniversary': self.weddingAnniversary.__format__('%B %d, %Y') if self.weddingAnniversaryLocal else None,
'Spouse/Partner': self.spouseName,
'Profession': self.profession,
'Children': ', '.join(self.childrensNames),
'Children': strListToStr(self.childrensNames),
'Hobbies': self.hobbies,
'Assistant': self.assistant,
'Web Page': self.webpageUrl,
Expand Down