aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-11-09 12:42:55 +0100
committerdec05eba <dec05eba@protonmail.com>2020-08-18 22:56:48 +0200
commitb25c227f2357e351d2c1653fdfdcd1f099ac7f66 (patch)
treef6be82e462e86177be190f9395427ae7d945856a /src
parent402a3fce0552abffe2ab2808b9657cd73885771f (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
{