From 06755d5eba2735d21177ff35d3137450d3bf412e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Aug 2019 16:08:40 +0530 Subject: [PATCH] Fix an error when adding files from clipboard and file is of unknown type --- src/calibre/gui2/actions/add.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/actions/add.py b/src/calibre/gui2/actions/add.py index b44458a2f9..d833efcb78 100644 --- a/src/calibre/gui2/actions/add.py +++ b/src/calibre/gui2/actions/add.py @@ -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)