Permalink
Browse files

[UPnP] crash with no configured network interfaces

fixes #13402
  • Loading branch information...
1 parent 4efdd79 commit 9777cc07e3b37370c8b8055725dedd13dfa0df5f @alcoheca alcoheca committed Oct 13, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 xbmc/network/upnp/UPnP.cpp
@@ -208,9 +208,11 @@ CUPnP::CUPnP() :
m_IP = g_application.getNetwork().GetFirstConnectedInterface()->GetCurrentIPAddress().c_str();
}
NPT_List<NPT_IpAddress> list;
- if (NPT_SUCCEEDED(PLT_UPnPMessageHelper::GetIPAddresses(list))) {
+ if (NPT_SUCCEEDED(PLT_UPnPMessageHelper::GetIPAddresses(list)) && list.GetItemCount()) {
m_IP = (*(list.GetFirstItem())).ToString();
}
+ else if(m_IP.IsEmpty())
+ m_IP = "localhost";
// start upnp monitoring
m_UPnP->Start();

0 comments on commit 9777cc0

Please sign in to comment.