Skip to content

Commit 5dc2382

Browse files
fix(Core/Player): prevent null pointer dereference in SendLoot function (#23965)
Co-authored-by: Roman BADANIN <[email protected]>
1 parent 8d31bce commit 5dc2382

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/server/game/Entities/Player/Player.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7894,7 +7894,9 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
78947894
// And permit out of range GO with no owner in case fishing hole
78957895
if (!go || (loot_type != LOOT_FISHINGHOLE && ((loot_type != LOOT_FISHING && loot_type != LOOT_FISHING_JUNK) || go->GetOwnerGUID() != GetGUID()) && !go->IsWithinDistInMap(this)) || (loot_type == LOOT_CORPSE && go->GetRespawnTime() && go->isSpawnedByDefault()))
78967896
{
7897-
go->ForceValuesUpdateAtIndex(GAMEOBJECT_BYTES_1);
7897+
if (go)
7898+
go->ForceValuesUpdateAtIndex(GAMEOBJECT_BYTES_1);
7899+
78987900
SendLootRelease(guid);
78997901
return;
79007902
}

0 commit comments

Comments
 (0)