mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Misc: Fix static analysis issues
Fix static analysis issues reported by Coverity
This commit is contained in:
@@ -316,7 +316,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b
|
||||
|
||||
Player* bad = ObjectAccessor::FindConnectedPlayerByName(badname);
|
||||
ObjectGuid victim = bad ? bad->GetGUID() : ObjectGuid::Empty;
|
||||
if (!victim || !IsOn(victim))
|
||||
if (!bad || !victim || !IsOn(victim))
|
||||
{
|
||||
PlayerNotFoundAppend appender(badname);
|
||||
ChannelNameBuilder<PlayerNotFoundAppend> builder(this, appender);
|
||||
@@ -463,7 +463,7 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo
|
||||
Player* newp = ObjectAccessor::FindConnectedPlayerByName(p2n);
|
||||
ObjectGuid victim = newp ? newp->GetGUID() : ObjectGuid::Empty;
|
||||
|
||||
if (!victim || !IsOn(victim) ||
|
||||
if (!newp || !victim || !IsOn(victim) ||
|
||||
(player->GetTeam() != newp->GetTeam() &&
|
||||
(!player->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) ||
|
||||
!newp->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL))))
|
||||
@@ -558,7 +558,7 @@ void Channel::SetOwner(Player const* player, std::string const& newname)
|
||||
Player* newp = ObjectAccessor::FindConnectedPlayerByName(newname);
|
||||
ObjectGuid victim = newp ? newp->GetGUID() : ObjectGuid::Empty;
|
||||
|
||||
if (!victim || !IsOn(victim) ||
|
||||
if (!newp || !victim || !IsOn(victim) ||
|
||||
(player->GetTeam() != newp->GetTeam() &&
|
||||
(!player->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) ||
|
||||
!newp->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL))))
|
||||
|
||||
Reference in New Issue
Block a user