Fix #1733: An unhandled exception occurred: GetPeer: Peer not found (possible timeout)
authorCraig Robbins <kde.psych@gmail.com>
Sun, 26 Oct 2014 05:32:49 +0000 (15:32 +1000)
committerkwolekr <kwolekr@minetest.net>
Tue, 28 Oct 2014 17:39:23 +0000 (13:39 -0400)
src/connection.cpp

index ee5b1eb0baa284ca54d7e5ab286ec6772dbab9c5..64ef9a50e42f9638008adeb0f9273190212068f8 100644 (file)
@@ -2322,7 +2322,12 @@ bool ConnectionReceiveThread::checkIncomingBuffers(Channel *channel,
 SharedBuffer<u8> ConnectionReceiveThread::processPacket(Channel *channel,
                SharedBuffer<u8> packetdata, u16 peer_id, u8 channelnum, bool reliable)
 {
-       PeerHelper peer = m_connection->getPeer(peer_id);
+       PeerHelper peer = m_connection->getPeerNoEx(peer_id);
+
+       if (!peer) {
+               errorstream << "Peer not found (possible timeout)" << std::endl;
+               throw ProcessedSilentlyException("Peer not found (possible timeout)");
+       }
 
        if(packetdata.getSize() < 1)
                throw InvalidIncomingDataException("packetdata.getSize() < 1");