From 5836a93b21070dda6704af40f782a0e2ba0a4a59 Mon Sep 17 00:00:00 2001 From: Eugene Dubinin Date: Thu, 13 Jan 2022 18:52:49 +0200 Subject: [PATCH] fixes KeyError on missing synonyms --- lbry/schema/mime_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbry/schema/mime_types.py b/lbry/schema/mime_types.py index 5dee9ccbc..daaf202e2 100644 --- a/lbry/schema/mime_types.py +++ b/lbry/schema/mime_types.py @@ -197,7 +197,7 @@ def guess_media_type(path): log.debug(f"file {path} does not have extension, identified by contents as {realext}") # don't do anything if extension is in synonyms - if not extension in synonyms_map[realext]: + if not extension in synonyms_map.get(realext, []): extension = realext except OSError as error: