From b211dae67baa109162ceaf1941dacd5eed4ab3b9 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Sat, 29 Apr 2017 06:32:48 +0300 Subject: [PATCH] Fix icon for undetectable files --- autoindex.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autoindex.py b/autoindex.py index 9179fbb..7c02c9d 100644 --- a/autoindex.py +++ b/autoindex.py @@ -35,9 +35,11 @@ def get_sort_link(current, sort, hidden): def get_file_icon(name): - t = guess_type(name)[0].split('/')[0] - if t in ['text', 'image', 'audio', 'video']: - return t + mime = guess_type(name)[0] + if mime: + t = mime.split('/')[0] + if t in ['text', 'image', 'audio', 'video']: + return t return ''