diff options
author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-09-27 14:12:10 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-18 22:26:58 +0100 |
commit | 157eca58d7811e8fbb78c089c686050751bac45c (patch) | |
tree | 1b8180f4ed1251ecfd260389ed2c0621b1747e79 | |
parent | 7da053be6687f739c4d6ae7d2dd5bd70fee5745c (diff) |
Core/Misc: Fix static analysis issues
Fix static analysis issues reported by Coverity
(cherry picked from commit ca8953a0ec8356345147b2bbc7bbdf0fa97cd625)
-rw-r--r-- | src/server/game/Chat/Channels/Channel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 022d4546a09..baea34a3108 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -350,7 +350,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b Player* bad = ObjectAccessor::FindConnectedPlayerByName(badname); ObjectGuid const& victim = bad ? bad->GetGUID() : ObjectGuid::Empty; - if (!victim || !IsOn(victim)) + if (!bad || !victim || !IsOn(victim)) { PlayerNotFoundAppend appender(badname); ChannelNameBuilder<PlayerNotFoundAppend> builder(this, appender); @@ -495,7 +495,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.IsEmpty() || !IsOn(victim) || + if (!newp || victim.IsEmpty() || !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)))) @@ -556,7 +556,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)))) |