Corrects null pointer exception when trying to log a packet whereas the socket is already closed.

This commit is contained in:
chenzo 2012-07-26 14:15:20 +00:00
parent 271dc3b9b4
commit 12e275f640

View File

@ -912,7 +912,10 @@ public class DelegatingDatagramSocket
nbSentOrReceivedRtpPackets);
}
if(isStunPacket || logThisRtpPacket)
// The interfaceAddress may be null if the socket is closed before this
// packet has been logged. In this cqse, this packet is not logged.
if((isStunPacket || logThisRtpPacket)
&& interfaceAddress != null)
{
InetAddress[] addr = {interfaceAddress, p.getAddress()};
int[] port = {interfacePort, p.getPort()};