fix(core): Handles a rare NPE with LoginTimer (#508)

This commit is contained in:
Kamron Batman 2021-02-11 23:47:02 -08:00 committed by GitHub
parent b8a625dcd3
commit 952a3e0265
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 118 additions and 127 deletions

View file

@ -403,10 +403,8 @@ namespace Server.Misc
Console.WriteLine("Login: {0}: Past IP limit threshold", e.State);
using (var op = new StreamWriter("ipLimits.log", true))
{
op.WriteLine("{0}\tPast IP limit threshold\t{1}", e.State, DateTime.UtcNow);
}
using var op = new StreamWriter("ipLimits.log", true);
op.WriteLine("{0}\tPast IP limit threshold\t{1}", e.State, DateTime.UtcNow);
return;
}
@ -414,7 +412,7 @@ namespace Server.Misc
var un = e.Username;
var pw = e.Password;
if (!(Accounts.GetAccount(un) is Account acct))
if (Accounts.GetAccount(un) is not Account acct)
{
e.Accepted = false;
}