From 21d24177c61acd246fb66039192b14f39f29c24f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 Mar 2021 09:19:26 +0530 Subject: [PATCH] Fix #1905257 [ebook-viewer: "Not a unicode string" when searching table of contents](https://bugs.launchpad.net/calibre/+bug/1905257) --- src/calibre/gui2/viewer/toc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/toc.py b/src/calibre/gui2/viewer/toc.py index 20d95004b4..10481370fb 100644 --- a/src/calibre/gui2/viewer/toc.py +++ b/src/calibre/gui2/viewer/toc.py @@ -231,7 +231,7 @@ class TOC(QStandardItemModel): def find_items(self, query): for item in self.all_items: text = item.text() - if text and primary_contains(query, text): + if not query or (text and primary_contains(query, text)): yield item def node_id_for_text(self, query):