Check if the remoteAddress is null before set it on DatagramPacket to prevent IllegalArgumentException. See #615
This commit is contained in:
parent
0c157a94cb
commit
fd8db4eba2
@ -205,7 +205,10 @@ public class OioDatagramChannel extends AbstractOioMessageChannel
|
||||
DatagramPacket p = (DatagramPacket) buf.poll();
|
||||
ByteBuf data = p.data();
|
||||
int length = data.readableBytes();
|
||||
tmpPacket.setSocketAddress(p.remoteAddress());
|
||||
InetSocketAddress remote = p.remoteAddress();
|
||||
if (remote != null) {
|
||||
tmpPacket.setSocketAddress(remote);
|
||||
}
|
||||
if (data.hasArray()) {
|
||||
tmpPacket.setData(data.array(), data.arrayOffset() + data.readerIndex(), length);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user