diff --git a/tabellio/searchform/cmpfunctions.py b/tabellio/searchform/cmpfunctions.py index 9a769fe..2f3c77a 100644 --- a/tabellio/searchform/cmpfunctions.py +++ b/tabellio/searchform/cmpfunctions.py @@ -8,8 +8,8 @@ def get_no_as_int(i): if i: if ' ' in i: try: - return int(re.match('\d+', i).group()) - except ValueError: + return int(re.match('\d+', i.strip()).group()) + except (ValueError, AttributeError): return 99999 try: return int(i.split('-')[0])