diff options
| author | Niels van Velzen <nielsvanvelzen@users.noreply.github.com> | 2025-08-07 21:49:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-07 21:49:59 +0200 |
| commit | 376220661bc1c982e7aba5c0ea2360b71c8c6a25 (patch) | |
| tree | 175d6df6c355d5bd24ab6e3854e43ff46c09a574 /Jellyfin.Api/Controllers/StartupController.cs | |
| parent | 9e88121647d9afe91ff2a6286ef25a10bdbf1c37 (diff) | |
| parent | c7c7b30d287cdc4fda2d6d7e633e0659a676b4bd (diff) | |
Merge pull request #14593 from Bond-009/revert
Revert "Merge pull request #13604 from Jxiced/master"
Diffstat (limited to 'Jellyfin.Api/Controllers/StartupController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/StartupController.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Jellyfin.Api/Controllers/StartupController.cs b/Jellyfin.Api/Controllers/StartupController.cs index 3bb68553d..09f20558f 100644 --- a/Jellyfin.Api/Controllers/StartupController.cs +++ b/Jellyfin.Api/Controllers/StartupController.cs @@ -1,4 +1,3 @@ -using System; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; @@ -132,16 +131,16 @@ public class StartupController : BaseJellyfinApiController [ProducesResponseType(StatusCodes.Status204NoContent)] public async Task<ActionResult> UpdateStartupUser([FromBody] StartupUserDto startupUserDto) { - ArgumentNullException.ThrowIfNull(startupUserDto.Name); - _userManager.ThrowIfInvalidUsername(startupUserDto.Name); - var user = _userManager.Users.First(); if (string.IsNullOrWhiteSpace(startupUserDto.Password)) { return BadRequest("Password must not be empty"); } - user.Username = startupUserDto.Name; + if (startupUserDto.Name is not null) + { + user.Username = startupUserDto.Name; + } await _userManager.UpdateUserAsync(user).ConfigureAwait(false); |
