aboutsummaryrefslogtreecommitdiff
path: root/include/salticidae/network.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/salticidae/network.h')
-rw-r--r--include/salticidae/network.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/salticidae/network.h b/include/salticidae/network.h
index b119e78..14d270f 100644
--- a/include/salticidae/network.h
+++ b/include/salticidae/network.h
@@ -598,7 +598,13 @@ bool PeerNetwork<O, _, __>::check_new_conn(const conn_t &conn, uint16_t port) {
conn->peer_id.ip = conn->get_addr().ip;
conn->peer_id.port = port;
}
- auto p = id2peer.find(conn->peer_id)->second.get();
+ auto it = id2peer.find(conn->peer_id);
+ if (it == id2peer.end())
+ {
+ conn->disp_terminate();
+ return true;
+ }
+ auto p = it->second.get();
if (p->connected)
{
if (conn != p->conn)