Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

Fix 'NoneType' guess_extension exception #88

Merged
merged 2 commits into from
Oct 9, 2018
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
3 changes: 3 additions & 0 deletions telegram_export/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ def get_extension(mime):
Returns the most common extension for the given mimetype, or '.bin' if
none can be found to indicate that it contains arbitrary binary data.
"""
if not mime:
mime = ''

return (
COMMON_MIME_TO_EXTENSION.get(mime)
or mimetypes.guess_extension(mime)
Expand Down