mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-06 03:48:40 +00:00
Fix argument parsing when deleting users from website
This commit is contained in:
parent
1b170081eb
commit
fc4c8d3278
1 changed files with 2 additions and 1 deletions
|
@ -28,7 +28,8 @@ public class DeleteUserCommand : ICommand
|
|||
UserEntity? user = await database.Users.FirstOrDefaultAsync(u => u.Username.Length > 0 && u.Username == args[0]);
|
||||
if (user == null)
|
||||
{
|
||||
user = await database.Users.FirstOrDefaultAsync(u => u.UserId == Convert.ToInt32(args[0]));
|
||||
_ = int.TryParse(args[0], out int userId);
|
||||
user = await database.Users.FirstOrDefaultAsync(u => u.UserId == userId);
|
||||
if (user == null)
|
||||
{
|
||||
logger.LogError($"Could not find user by parameter '{args[0]}'", LogArea.Command);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue