Added an ArgumentNullException sanity check to let devs know it’s not allowed here, and checked before calling the method. The standard validation pipeline does the rest as it is marked [Required]

This commit is contained in:
Sebastien Ros
2010-04-16 13:31:36 -07:00
parent d4b79ea272
commit bea0266688
2 changed files with 5 additions and 1 deletions

View File

@@ -44,6 +44,9 @@ namespace Orchard.Users.Services {
}
public IUser GetUser(string username) {
if(username == null) {
throw new ArgumentNullException("username");
}
var userRecord = _userRepository.Get(x => x.NormalizedUserName == username.ToLower());
if (userRecord == null) {
return null;