diff --git a/src/calibre/gui2/open_with.py b/src/calibre/gui2/open_with.py index 8be6ce407d..33d0c162b4 100644 --- a/src/calibre/gui2/open_with.py +++ b/src/calibre/gui2/open_with.py @@ -184,6 +184,8 @@ else: def entry_to_item(entry, parent): icon_path = entry.get('Icon') or I('blank.png') + if not isinstance(icon_path, basestring): + icon_path = I('blank.png') ans = QListWidgetItem(QIcon(icon_path), entry.get('Name') or _('Unknown'), parent) ans.setData(ENTRY_ROLE, entry) comment = (entry.get('Comment') or '') diff --git a/src/calibre/utils/open_with/linux.py b/src/calibre/utils/open_with/linux.py index c5f6495235..5fbd70503d 100644 --- a/src/calibre/utils/open_with/linux.py +++ b/src/calibre/utils/open_with/linux.py @@ -191,6 +191,8 @@ def find_programs(extensions): data['Icon'] = icon else: data.pop('Icon') + if not isinstance(data.get('Icon'), basestring): + data.pop('Icon', None) for k in ('Name', 'GenericName', 'Comment'): val = data.get(k) if val: