Skip to content

Commit

Permalink
check router for null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Nov 23, 2023
1 parent d327533 commit c215f2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libi2pd/NetDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ namespace data
auto own = i2p::context.GetSharedRouterInfo ();
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();
if (it.second->IsUpdated ())
{
Expand Down Expand Up @@ -698,7 +698,7 @@ namespace data
std::unique_lock<std::mutex> l(m_RouterInfosMutex);
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);
else
{
Expand Down

0 comments on commit c215f2e

Please sign in to comment.