UPnP: Fix NPE (android gitlab ticket #1)

This commit is contained in:
zzz
2021-01-30 08:35:33 -05:00
parent af6ecde867
commit 33397433ac

View File

@@ -202,8 +202,11 @@ public class HTTPUSocket
ssdpUniSock.send(dgmPacket);
}
catch (Exception e) {
Debug.warning("addr = " +ssdpUniSock.getLocalAddress().getHostName());
Debug.warning("port = " + ssdpUniSock.getLocalPort());
// I2P prevent NPE android gitlab #1
if (ssdpUniSock != null) {
Debug.warning("addr = " +ssdpUniSock.getLocalAddress().getHostName());
Debug.warning("port = " + ssdpUniSock.getLocalPort());
}
Debug.warning(e);
return false;
}