mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-09-26 03:09:06 +00:00
Prevent placeholder user from being renamed
This commit is contained in:
parent
c9e5295338
commit
6e1c1ee730
1 changed files with 7 additions and 0 deletions
|
@ -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];
|
user.Username = args[1];
|
||||||
await database.SaveChangesAsync();
|
await database.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue