aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/StartupController.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2025-08-06 15:49:40 +0200
committerBond_009 <bond.009@outlook.com>2025-08-06 15:49:40 +0200
commitc7c7b30d287cdc4fda2d6d7e633e0659a676b4bd (patch)
tree92dd79a7041604b1d159073cc195c81c2521e6dd /Jellyfin.Api/Controllers/StartupController.cs
parent6d4efe6523d925398d64a889321f8cdc21eea915 (diff)
Revert "Merge pull request #13604 from Jxiced/master"
This reverts commit ce78af2ed4f203690a0f9ef87b08b27a6bd43f63, reversing changes made to db7465e83d9cc07134a0bffad7ed17b1c7b873da.
Diffstat (limited to 'Jellyfin.Api/Controllers/StartupController.cs')
-rw-r--r--Jellyfin.Api/Controllers/StartupController.cs9
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);