From 739b6645f8941af16ea9869be17c9dda13b429fd Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 2 Dec 2016 16:10:49 -0500 Subject: [PATCH] eliminate bad_function_call exception --- Destination.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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); } }