From 3bfa3e98672015a88fe320492f4deb4dd986cc3f Mon Sep 17 00:00:00 2001 From: Urban Wallasch Date: Tue, 15 Jun 2021 18:05:57 +0200 Subject: [PATCH] * Catch exception caused by malformed search term in result formatter. --- jiten-pai.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jiten-pai.py b/jiten-pai.py index 753ba7a..d4eef5c 100755 --- a/jiten-pai.py +++ b/jiten-pai.py @@ -863,7 +863,10 @@ class jpMainWindow(QMainWindow): return # format result term = self.search_box.lineEdit().text() - re_term = re.compile(kata2hira(term), re.IGNORECASE) + try: + re_term = re.compile(kata2hira(term), re.IGNORECASE) + except: + re_term = re.compile('', re.IGNORECASE) nfmt = '
' % (cfg['nfont'], cfg['nfont_sz']) lfmt = '' % (cfg['lfont'], cfg['lfont_sz']) hlfmt = '' % cfg['hl_col'] -- 2.30.2