فهرست منبع

Fix possible NullReferenceException

Patrick Barron 4 سال پیش
والد
کامیت
d887e42405
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      Jellyfin.Server.Implementations/Users/UserManager.cs

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

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