fix: Cleans up some string allocations from trim (#1759)
This commit is contained in:
parent
9d2f471e91
commit
d77668d77a
9 changed files with 15 additions and 22 deletions
|
|
@ -309,7 +309,7 @@ public static class AccountHandler
|
|||
if (Accounts.GetAccount(un) is not Account acct)
|
||||
{
|
||||
// To prevent someone from making an account of just '' or a bunch of meaningless spaces
|
||||
if (AutoAccountCreation && un.Trim().Length > 0)
|
||||
if (AutoAccountCreation && !string.IsNullOrWhiteSpace(un))
|
||||
{
|
||||
e.State.Account = acct = CreateAccount(e.State, un, pw);
|
||||
e.Accepted = acct?.CheckAccess(e.State) ?? false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue