aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/UserManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/UserManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/UserManager.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/UserManager.cs b/MediaBrowser.Server.Implementations/Library/UserManager.cs
index 1b3f64984..86c908d05 100644
--- a/MediaBrowser.Server.Implementations/Library/UserManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/UserManager.cs
@@ -159,7 +159,12 @@ namespace MediaBrowser.Server.Implementations.Library
throw new ArgumentNullException("username");
}
- var user = Users.First(i => string.Equals(username, i.Name, StringComparison.OrdinalIgnoreCase));
+ var user = Users.FirstOrDefault(i => string.Equals(username, i.Name, StringComparison.OrdinalIgnoreCase));
+
+ if (user == null)
+ {
+ throw new AuthenticationException("Invalid username or password entered.");
+ }
if (user.Configuration.IsDisabled)
{