Преглед на файлове

Merge pull request #4378 from barronpm/fix-nullref

Fix possible null reference exception
Bond-009 преди 5 години
родител
ревизия
e37805e82e
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      Jellyfin.Server.Implementations/Users/UserManager.cs

+ 1 - 1
Jellyfin.Server.Implementations/Users/UserManager.cs

@@ -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());