Merge pull request #4378 from barronpm/fix-nullref

Fix possible null reference exception
pull/4395/head
Bond-009 4 years ago committed by GitHub
commit e37805e82e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -432,7 +432,7 @@ namespace Jellyfin.Server.Implementations.Users
// the authentication provider might have created it
user = Users.FirstOrDefault(i => string.Equals(username, i.Username, StringComparison.OrdinalIgnoreCase));
if (authenticationProvider is IHasNewUserPolicy hasNewUserPolicy)
if (authenticationProvider is IHasNewUserPolicy hasNewUserPolicy && user != null)
{
UpdatePolicy(user.Id, hasNewUserPolicy.GetNewUserPolicy());

Loading…
Cancel
Save