mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
Fix segfault when UPnP is enabled
Added null check. Signed-off-by: kleenex <kleenex@i2pmail.org>
This commit is contained in:
parent
321c7cb7cf
commit
55be5c74f0
|
@ -163,7 +163,7 @@ namespace transport
|
|||
if (!a) return;
|
||||
for (const auto& address : *a)
|
||||
{
|
||||
if (!address->host.is_v6 () && address->port)
|
||||
if (address && !address->host.is_v6 () && address->port)
|
||||
TryPortMapping (address);
|
||||
}
|
||||
m_Timer.expires_from_now (boost::posix_time::minutes(20)); // every 20 minutes
|
||||
|
@ -215,7 +215,7 @@ namespace transport
|
|||
if (!a) return;
|
||||
for (const auto& address : *a)
|
||||
{
|
||||
if (!address->host.is_v6 () && address->port)
|
||||
if (address && !address->host.is_v6 () && address->port)
|
||||
CloseMapping (address);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue