diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index a3b9e0618f..e16079efb2 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -1299,11 +1299,7 @@ class Cache(object): string. ''' table = self.fields['authors'].table result = [] - try: - rmap = {icu_lower(v):k for k, v in table.id_map.iteritems()} - except AttributeError: - # Somehow, the authors table has some authors that are None. Corrupted db? - rmap = {icu_lower(v or ''):k for k, v in table.id_map.iteritems()} + rmap = {icu_lower(v):k for k, v in table.id_map.iteritems()} for aut in authors: aid = rmap.get(icu_lower(aut), None) result.append(author_to_author_sort(aut) if aid is None else table.asort_map[aid]) diff --git a/src/calibre/db/tables.py b/src/calibre/db/tables.py index f2ccbe0c39..295558c313 100644 --- a/src/calibre/db/tables.py +++ b/src/calibre/db/tables.py @@ -56,7 +56,7 @@ class Table(object): }.get(metadata['datatype'], None) if name == 'authors': # Legacy - self.unserialize = lambda x: x.replace('|', ',') if x else None + self.unserialize = lambda x: x.replace('|', ',') if x else '' self.link_table = (link_table if link_table else 'books_%s_link'%self.metadata['table'])