aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksi Lindeman <dec05eba@protonmail.com>2018-11-09 12:42:55 +0100
committerAleksi Lindeman <dec05eba@protonmail.com>2018-11-09 12:42:55 +0100
commit2b7ed06dcaa149f9ecc800ec17435dca1c04b861 (patch)
treedb6abe8fec9c4672a47d00298dcc229bc091ea0c /src
parent11ee593a8387cf2ca0bcdbaf0d39ad69bee6dec4 (diff)
Maybe this will fix crash...
Diffstat (limited to 'src')
-rw-r--r--src/DirectConnection.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/DirectConnection.cpp b/src/DirectConnection.cpp
index a00eeea..e5a997f 100644
--- a/src/DirectConnection.cpp
+++ b/src/DirectConnection.cpp
@@ -309,7 +309,13 @@ namespace sibs
if(receivedDataStatus == 0)
{
peersMutex.lock();
- auto peer = peers[receivedDataFromPeer];
+ auto peerIt = peers.find(receivedDataFromPeer);
+ if(peerIt == peers.end())
+ {
+ peersMutex.unlock();
+ continue;
+ }
+ auto peer = peerIt->second;
peersMutex.unlock();
try
{