Skip to content

Commit

Permalink
Fail silently for get_user(None)
Browse files Browse the repository at this point in the history
get_user(identifier) checks if the identifier is a number by trying to convert it to int. This works for strings, but in a particular case, when identifier is None, it fails. Checking for both TypeError and ValueError fixes it.
  • Loading branch information
alexef committed Nov 19, 2014
1 parent c7d0ea9 commit 7e4fc94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flask_security/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def get_user(self, identifier):
def _is_numeric(self, value):
try:
int(value)
except ValueError:
except (TypeError, ValueError):
return False
return True

Expand Down

0 comments on commit 7e4fc94

Please sign in to comment.