Fix an error when adding files from clipboard and file is of unknown type

This commit is contained in:
Kovid Goyal 2019-08-20 16:08:40 +05:30
parent ced7df0b20
commit 06755d5eba
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -127,7 +127,7 @@ class AddAction(InterfaceAction):
path = url.toLocalFile()
if os.access(path, os.R_OK):
mt = guess_type(path)[0]
if mt.startswith('image/'):
if mt and mt.startswith('image/'):
images.append(path)
else:
files_to_add.append(path)