From 9bd75cd6c40f8396b2580a54533d441eb528f24d Mon Sep 17 00:00:00 2001 From: Timothy Schenk Date: Wed, 22 Nov 2023 10:24:23 +0100 Subject: [PATCH] fix: null id when first created --- Server/PacketHandlers/LoginHandler.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Server/PacketHandlers/LoginHandler.cs b/Server/PacketHandlers/LoginHandler.cs index 1e9a1ba..dc645c3 100644 --- a/Server/PacketHandlers/LoginHandler.cs +++ b/Server/PacketHandlers/LoginHandler.cs @@ -33,15 +33,14 @@ public class LoginHandler : IPacketHandler { LoginResponseReason loginResponseReason; _logger.LoginData(packet.Username, packet.Password); - var account = await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username) - ; + var account = await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username); if (account == null) { if (_configuration.GetSection("Testing").GetValue("CreateAccountOnLogin")) { - loginResponseReason = await CreateAccountOnLoginAsync(packet.Username, packet.Password) - ; + loginResponseReason = await CreateAccountOnLoginAsync(packet.Username, packet.Password); + account = await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username); } else {