From e7bc86ebb8496615e0b3f73eb4f13ab4c0913dc8 Mon Sep 17 00:00:00 2001 From: Jxiced Date: Sun, 23 Feb 2025 22:16:35 +0000 Subject: Move throw into interface to use in wizard, check for null and invalid username. --- Jellyfin.Server.Implementations/Users/UserManager.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Jellyfin.Server.Implementations') diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs index 91cf9c972f..5a11fadc53 100644 --- a/Jellyfin.Server.Implementations/Users/UserManager.cs +++ b/Jellyfin.Server.Implementations/Users/UserManager.cs @@ -176,10 +176,6 @@ namespace Jellyfin.Server.Implementations.Users /// public async Task UpdateUserAsync(User user) { - ArgumentNullException.ThrowIfNull(user); - - ThrowIfInvalidUsername(user.Username); - var dbContext = await _dbProvider.CreateDbContextAsync().ConfigureAwait(false); await using (dbContext.ConfigureAwait(false)) { @@ -737,7 +733,8 @@ namespace Jellyfin.Server.Implementations.Users _users[user.Id] = user; } - internal static void ThrowIfInvalidUsername(string name) + /// + public void ThrowIfInvalidUsername(string name) { if (!string.IsNullOrWhiteSpace(name) && ValidUsernameRegex().IsMatch(name)) { -- cgit v1.2.3