Prevent exception with search text.

This commit is contained in:
John Schember 2009-06-28 17:59:33 -04:00
parent 1a10ff20ad
commit 0a9ddcda0c

View File

@ -240,6 +240,8 @@ class BooksModel(QAbstractTableModel):
self.count_changed() self.count_changed()
def clean_search_text(self, text): def clean_search_text(self, text):
if not text:
return text
tokens = text.split(' ') tokens = text.split(' ')
for i, token in enumerate(tokens): for i, token in enumerate(tokens):
if token.strip().endswith(':') or token.strip() == '': if token.strip().endswith(':') or token.strip() == '':