fixes KeyError on missing synonyms

This commit is contained in:
Eugene Dubinin 2022-01-13 18:52:49 +02:00
parent 557348e345
commit 5836a93b21

View file

@ -197,7 +197,7 @@ def guess_media_type(path):
log.debug(f"file {path} does not have extension, identified by contents as {realext}") log.debug(f"file {path} does not have extension, identified by contents as {realext}")
# don't do anything if extension is in synonyms # 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 extension = realext
except OSError as error: except OSError as error: