aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-09-06 19:39:23 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-09-06 19:39:23 +0300
commitfaf3d7902aaf1a8eeaf339a127b267d97cd61cd6 (patch)
treea0002b44756b12001f8d216114b952b267ae5e5c
parent63f1ded16708f6419c1d0aa547d7b202f7098739 (diff)
downloadminetest-faf3d7902aaf1a8eeaf339a127b267d97cd61cd6.tar.gz
minetest-faf3d7902aaf1a8eeaf339a127b267d97cd61cd6.tar.bz2
minetest-faf3d7902aaf1a8eeaf339a127b267d97cd61cd6.zip
Make Connection::Send cancel silently if peer doesn't exist.
-rw-r--r--src/connection.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/connection.cpp b/src/connection.cpp
index 548a7f532..89cb7dd0b 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -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;