diff --git a/ProjectLighthouse/Administration/Maintenance/Commands/RenameUserCommand.cs b/ProjectLighthouse/Administration/Maintenance/Commands/RenameUserCommand.cs index 67a380b6..8e34051b 100644 --- a/ProjectLighthouse/Administration/Maintenance/Commands/RenameUserCommand.cs +++ b/ProjectLighthouse/Administration/Maintenance/Commands/RenameUserCommand.cs @@ -37,6 +37,13 @@ public class RenameUserCommand : ICommand } } + // prevent the placeholder user from being renamed + if (user.Username.Length == 0) + { + logger.LogError("Cannot rename the placeholder user", LogArea.Command); + return; + } + user.Username = args[1]; await database.SaveChangesAsync();