1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

null check

This commit is contained in:
Jeff Becker 2019-05-12 17:21:18 -04:00
parent b5602228a3
commit 686fb311ad
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05

View file

@ -65,7 +65,8 @@ struct TryConnectJob
Failed() Failed()
{ {
llarp::LogInfo("session to ", llarp::RouterID(rc.pubkey), " closed"); llarp::LogInfo("session to ", llarp::RouterID(rc.pubkey), " closed");
link->CloseSessionTo(rc.pubkey); if(link)
link->CloseSessionTo(rc.pubkey);
// delete this // delete this
router->pendingEstablishJobs.erase(rc.pubkey); router->pendingEstablishJobs.erase(rc.pubkey);
} }
@ -97,6 +98,8 @@ struct TryConnectJob
Attempt() Attempt()
{ {
--triesLeft; --triesLeft;
if(!link)
return false;
if(!link->TryEstablishTo(rc)) if(!link->TryEstablishTo(rc))
{ {
return true; return true;