fix(Core/Channel): potential nullptr reference in Channel::SetOwner() (#17906)
This commit is contained in:
parent
e1cec2bbcf
commit
8eed7ee531
1 changed files with 16 additions and 14 deletions
|
|
@ -884,23 +884,25 @@ void Channel::SetOwner(ObjectGuid guid, bool exclaim)
|
|||
pinfo.SetModerator(true);
|
||||
uint8 oldFlag = pinfo.flags;
|
||||
pinfo.SetOwner(true);
|
||||
|
||||
Player* player = ObjectAccessor::FindPlayer(_ownerGUID);
|
||||
|
||||
WorldPacket data;
|
||||
|
||||
if (ShouldAnnouncePlayer(player))
|
||||
{
|
||||
MakeModeChange(&data, _ownerGUID, oldFlag);
|
||||
SendToAll(&data);
|
||||
}
|
||||
|
||||
FlagsNotify(pinfo.plrPtr);
|
||||
|
||||
if (exclaim && ShouldAnnouncePlayer(player))
|
||||
Player* player = ObjectAccessor::FindPlayer(_ownerGUID);
|
||||
if (player)
|
||||
{
|
||||
MakeOwnerChanged(&data, _ownerGUID);
|
||||
SendToAll(&data);
|
||||
if (ShouldAnnouncePlayer(player))
|
||||
{
|
||||
WorldPacket data;
|
||||
|
||||
MakeModeChange(&data, _ownerGUID, oldFlag);
|
||||
SendToAll(&data);
|
||||
|
||||
if (exclaim)
|
||||
{
|
||||
// MakeOwnerChanged will reset the packet for us
|
||||
MakeOwnerChanged(&data, _ownerGUID);
|
||||
SendToAll(&data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue