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 2021-03-11 09:19:26 +05:30
parent da779f6f2f
commit 21d24177c6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -231,7 +231,7 @@ 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:
text = item.text() text = item.text()
if text and primary_contains(query, text): if not query or (text and primary_contains(query, text)):
yield item yield item
def node_id_for_text(self, query): def node_id_for_text(self, query):