Преглед изворни кода

Prevent whitespaces in username during wizard setup.

Jxiced пре 5 месеци
родитељ
комит
70d07b830d
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      Jellyfin.Server.Implementations/Users/UserManager.cs

+ 4 - 0
Jellyfin.Server.Implementations/Users/UserManager.cs

@@ -176,6 +176,10 @@ namespace Jellyfin.Server.Implementations.Users
         /// <inheritdoc/>
         public async Task UpdateUserAsync(User user)
         {
+            ArgumentNullException.ThrowIfNull(user);
+
+            ThrowIfInvalidUsername(user.Username);
+
             var dbContext = await _dbProvider.CreateDbContextAsync().ConfigureAwait(false);
             await using (dbContext.ConfigureAwait(false))
             {