mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-07-11 03:13:10 +00:00
fix(Core/RBAC): guard against null RBACData in .rbac account commands (#25724)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
@@ -74,8 +74,10 @@ public:
|
||||
|
||||
static RBACCommandData GetRBACData(uint32 accountId, std::string const& accountName)
|
||||
{
|
||||
// session->GetRBACData() can be null after World::ReloadRBAC()
|
||||
if (WorldSession* session = sWorldSessionMgr->FindSession(accountId))
|
||||
return { session->GetRBACData(), false };
|
||||
if (rbac::RBACData* sessionRbac = session->GetRBACData())
|
||||
return { sessionRbac, false };
|
||||
|
||||
rbac::RBACData* rbac = new rbac::RBACData(accountId, accountName, realm.Id.Realm, AccountMgr::GetSecurity(accountId, realm.Id.Realm));
|
||||
rbac->LoadFromDB();
|
||||
|
||||
Reference in New Issue
Block a user