1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-31 09:04:14 +00:00

check router for null pointer

This commit is contained in:
orignal 2023-11-23 13:06:50 -05:00
parent d327533b56
commit c215f2e8d1

View File

@ -628,7 +628,7 @@ namespace data
auto own = i2p::context.GetSharedRouterInfo (); auto own = i2p::context.GetSharedRouterInfo ();
for (auto& it: m_RouterInfos) for (auto& it: m_RouterInfos)
{ {
if (it.second == own) continue; // skip own if (!it.second || it.second == own) continue; // skip own
std::string ident = it.second->GetIdentHashBase64(); std::string ident = it.second->GetIdentHashBase64();
if (it.second->IsUpdated ()) if (it.second->IsUpdated ())
{ {
@ -698,7 +698,7 @@ namespace data
std::unique_lock<std::mutex> l(m_RouterInfosMutex); std::unique_lock<std::mutex> l(m_RouterInfosMutex);
for (auto it = m_RouterInfos.begin (); it != m_RouterInfos.end ();) for (auto it = m_RouterInfos.begin (); it != m_RouterInfos.end ();)
{ {
if (it->second->IsUnreachable ()) if (!it->second || it->second->IsUnreachable ())
it = m_RouterInfos.erase (it); it = m_RouterInfos.erase (it);
else else
{ {