mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user