diff --git a/hasjob/utils.py b/hasjob/utils.py index 371376db..8e063f66 100644 --- a/hasjob/utils.py +++ b/hasjob/utils.py @@ -69,9 +69,12 @@ def string_to_number(value): """ Convert a string containing a formatted number into an integer. """ + if not value: + return None value = NO_NUM_RE.sub('', value) if value: return int(value) + return None #: This code adapted from http://en.wikipedia.org/wiki/Base_36#Python%5FConversion%5FCode