fix(Core/WorldSession): prevent crash in SendPacket (#6045)

This commit is contained in:
Francesco Borzì 2021-05-25 18:05:13 +02:00 committed by GitHub
parent 9bea4dc011
commit 3716ddf3e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -200,7 +200,11 @@ ObjectGuid::LowType WorldSession::GetGuidLow() const
/// Send a packet to the client
void WorldSession::SendPacket(WorldPacket const* packet)
{
ASSERT(packet->GetOpcode() != NULL_OPCODE);
if (packet->GetOpcode() == NULL_OPCODE)
{
LOG_ERROR("server", "WorldSession::SendPacket(packet) called, but packet->GetOpcode() was NULL_OPCODE");
return;
}
if (!m_Socket)
return;