mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-28 23:17:19 +00:00
wmlunits: Handle TypeError on int_fallback() (in particular to deal with None)
This commit is contained in:
parent
0f171cd364
commit
3746925eab
@ -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…
x
Reference in New Issue
Block a user