From 414bc629e4d3d9d1af0b05cd24e923821076f214 Mon Sep 17 00:00:00 2001 From: iEvE Date: Sat, 21 Jan 2023 16:54:38 +1000 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=90=D0=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DiIiS-NA/BGS-Server/AccountsSystem/AccountManager.cs | 5 +++++ src/DiIiS-NA/BGS-Server/AccountsSystem/GameAccountManager.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/DiIiS-NA/BGS-Server/AccountsSystem/AccountManager.cs b/src/DiIiS-NA/BGS-Server/AccountsSystem/AccountManager.cs index 0f132f4..b841007 100644 --- a/src/DiIiS-NA/BGS-Server/AccountsSystem/AccountManager.cs +++ b/src/DiIiS-NA/BGS-Server/AccountsSystem/AccountManager.cs @@ -206,8 +206,13 @@ namespace DiIiS_NA.LoginServer.AccountsSystem public static Account GetAccountByDBAccount(DBAccount dbAccount) { + if (dbAccount == null) + return null; if (LoadedAccounts.ContainsKey(dbAccount.Id)) + { + LoadedAccounts[dbAccount.Id].DBAccount = dbAccount; return LoadedAccounts[dbAccount.Id]; + } else { var account = new Account(dbAccount); diff --git a/src/DiIiS-NA/BGS-Server/AccountsSystem/GameAccountManager.cs b/src/DiIiS-NA/BGS-Server/AccountsSystem/GameAccountManager.cs index 7a4a30d..d6681ff 100644 --- a/src/DiIiS-NA/BGS-Server/AccountsSystem/GameAccountManager.cs +++ b/src/DiIiS-NA/BGS-Server/AccountsSystem/GameAccountManager.cs @@ -40,8 +40,13 @@ namespace DiIiS_NA.LoginServer.AccountsSystem public static GameAccount GetGameAccountByDBGameAccount(DBGameAccount dbGameAccount) { + if (dbGameAccount == null) + return null; if (LoadedGameAccounts.ContainsKey(dbGameAccount.Id)) + { + LoadedGameAccounts[dbGameAccount.Id].DBGameAccount = dbGameAccount; return LoadedGameAccounts[dbGameAccount.Id]; + } else { var account = new GameAccount(dbGameAccount);