This commit is contained in:
Kovid Goyal 2022-05-14 17:29:09 +05:30
parent cc7d9d08f3
commit 8fbf09a641
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -264,7 +264,10 @@ class TOC(QStandardItemModel):
def find_items(self, query):
for item in self.all_items:
text = item.text()
if not query or (text and primary_contains(query, text)):
if query and isinstance(query, str):
if text and isinstance(text, str) and primary_contains(query, text):
yield item
else:
yield item
def items_at_depth(self, depth):