summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2012-06-05 10:55:03 (GMT)
committerFrédéric Péters <fpeters@0d.be>2012-06-05 10:55:03 (GMT)
commit42d241d89e529e41544cca3df48ac3c61efffc29 (patch)
treeb9c154556e75896d462cb1c1b7389ad6e92a8b59
parent77dc6a2fc879019d42cf8f39351b3723edec3c65 (diff)
downloadtabellio.searchform-42d241d89e529e41544cca3df48ac3c61efffc29.zip
tabellio.searchform-42d241d89e529e41544cca3df48ac3c61efffc29.tar.gz
tabellio.searchform-42d241d89e529e41544cca3df48ac3c61efffc29.tar.bz2
protect against numbers that do not have any numbers
-rw-r--r--tabellio/searchform/cmpfunctions.py4
1 files changed, 2 insertions, 2 deletions
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])