Fixed NPE in OioDatagramWorker.writeNow()
This commit is contained in:
parent
01d8de26cf
commit
ee3ae043dc
@ -117,7 +117,11 @@ class OioDatagramWorker implements Runnable {
|
|||||||
ChannelBuffer a = (ChannelBuffer) message;
|
ChannelBuffer a = (ChannelBuffer) message;
|
||||||
byte[] b = new byte[a.readableBytes()];
|
byte[] b = new byte[a.readableBytes()];
|
||||||
a.getBytes(0, b);
|
a.getBytes(0, b);
|
||||||
channel.socket.send(new DatagramPacket(b, b.length, remoteAddress));
|
DatagramPacket packet = new DatagramPacket(b, b.length);
|
||||||
|
if (remoteAddress != null) {
|
||||||
|
packet.setSocketAddress(remoteAddress);
|
||||||
|
}
|
||||||
|
channel.socket.send(packet);
|
||||||
fireWriteComplete(channel, b.length);
|
fireWriteComplete(channel, b.length);
|
||||||
future.setSuccess();
|
future.setSuccess();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user