diff --git a/telegram_export/utils.py b/telegram_export/utils.py index 0212e51..851c888 100644 --- a/telegram_export/utils.py +++ b/telegram_export/utils.py @@ -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)