Fix #1905257 [ebook-viewer: "Not a unicode string" when searching table of contents](https://bugs.launchpad.net/calibre/+bug/1905257)

This commit is contained in:
Kovid Goyal 2020-11-23 15:41:58 +05:30
parent 54dbba6f06
commit dc4f752ffb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -219,7 +219,8 @@ class TOC(QStandardItemModel):
def find_items(self, query): def find_items(self, query):
for item in self.all_items: for item in self.all_items:
if primary_contains(query, item.text()): text = item.text()
if text and primary_contains(query, text):
yield item yield item
def node_id_for_text(self, query): def node_id_for_text(self, query):