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

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;