Make Connection::Send cancel silently if peer doesn't exist.

This commit is contained in:
Perttu Ahola 2011-09-06 19:39:23 +03:00
parent 63f1ded167
commit faf3d7902a
1 changed files with 3 additions and 1 deletions

View File

@ -1121,7 +1121,9 @@ void Connection::Send(u16 peer_id, u8 channelnum,
{
assert(channelnum < CHANNEL_COUNT);
Peer *peer = GetPeer(peer_id);
Peer *peer = GetPeerNoEx(peer_id);
if(peer == NULL)
return;
Channel *channel = &(peer->channels[channelnum]);
u32 chunksize_max = m_max_packet_size - BASE_HEADER_SIZE;