From 748eb921c5294e5f3a2558f968d7684fed0e1d5c Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sat, 27 Jul 2013 10:32:49 +0200 Subject: [PATCH] Prevent exception when deleting a non-existent book. --- src/calibre/library/caches.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index e552ead591..022ba9402e 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -920,7 +920,8 @@ class ResultCache(SearchQueryParser): # {{{ def remove(self, id): try: - self._uuid_map.pop(self._data[id][self._uuid_column_index], None) + if self._data[id] is not None: + self._uuid_map.pop(self._data[id][self._uuid_column_index], None) except IndexError: pass # id is out of bounds -- no uuid in the map to remove try: