Fix #1873045 [Calibre - 'NoneType' object is not iterable](https://bugs.launchpad.net/calibre/+bug/1873045)

This commit is contained in:
Kovid Goyal 2020-04-16 08:35:00 +05:30
parent 175282da52
commit 65d9d72588
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -928,10 +928,6 @@ def data(self, index, role):
id_ = self.id(index)
self.column_color.mi = None
if self.color_row_fmt_cache is None:
self.color_row_fmt_cache = tuple(fmt for key, fmt in
self.db.prefs['column_color_rules'] if key == color_row_key)
for k, fmt in self.db.prefs['column_color_rules']:
if k == key:
ccol = self.column_color(id_, key, fmt, self.db,
@ -954,6 +950,9 @@ def data(self, index, role):
except:
pass
if self.color_row_fmt_cache is None:
self.color_row_fmt_cache = tuple(fmt for key, fmt in
self.db.prefs['column_color_rules'] if key == color_row_key)
for fmt in self.color_row_fmt_cache:
ccol = self.column_color(id_, color_row_key, fmt, self.db,
self.color_cache, self.color_template_cache)