wmlunits: Handle TypeError on int_fallback() (in particular to deal with None)
This commit is contained in:
parent
0f171cd364
commit
3746925eab
1 changed files with 2 additions and 0 deletions
|
@ -171,6 +171,8 @@ def reset_errors():
|
|||
def int_fallback(str_value, int_fallback=0):
|
||||
try:
|
||||
return int(str_value)
|
||||
except TypeError:
|
||||
return int_fallback
|
||||
except ValueError:
|
||||
return int_fallback
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue