From: Perttu Ahola <celeron55@gmail.com>
Date: Tue, 6 Sep 2011 16:39:23 +0000 (+0300)
Subject: Make Connection::Send cancel silently if peer doesn't exist.
X-Git-Tag: 0.2.20110922~12
X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=faf3d7902aaf1a8eeaf339a127b267d97cd61cd6;p=oweals%2Fminetest.git

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

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;