diff --git a/Destination.cpp b/Destination.cpp index 3a5846bd..61960464 100644 --- a/Destination.cpp +++ b/Destination.cpp @@ -527,7 +527,8 @@ namespace client if (floodfill) { auto request = std::make_shared (m_Service); - request->requestComplete.push_back (requestComplete); + if (requestComplete) + request->requestComplete.push_back (requestComplete); auto ts = i2p::util::GetSecondsSinceEpoch (); auto ret = m_LeaseSetRequests.insert (std::pair >(dest,request)); if (ret.second) // inserted @@ -537,7 +538,7 @@ namespace client { // request failed m_LeaseSetRequests.erase (ret.first); - requestComplete (nullptr); + if (requestComplete) requestComplete (nullptr); } } else // duplicate @@ -547,13 +548,13 @@ namespace client //ret.first->second->requestComplete.push_back (requestComplete); if (ts > ret.first->second->requestTime + MAX_LEASESET_REQUEST_TIMEOUT) m_LeaseSetRequests.erase (ret.first); - requestComplete (nullptr); + if (requestComplete) requestComplete (nullptr); } } else { LogPrint (eLogError, "Destination: Can't request LeaseSet, no floodfills found"); - requestComplete (nullptr); + if (requestComplete) requestComplete (nullptr); } }