Fixed NPE in OioWorker.write when the socket is closed already
This commit is contained in:
parent
cfa4e5e4ee
commit
fb8cc156f3
@ -117,7 +117,15 @@ class OioWorker implements Runnable {
|
|||||||
static void write(
|
static void write(
|
||||||
OioSocketChannel channel, ChannelFuture future,
|
OioSocketChannel channel, ChannelFuture future,
|
||||||
Object message) {
|
Object message) {
|
||||||
|
|
||||||
OutputStream out = channel.getOutputStream();
|
OutputStream out = channel.getOutputStream();
|
||||||
|
if (out == null) {
|
||||||
|
Exception e = new ClosedChannelException();
|
||||||
|
future.setFailure(e);
|
||||||
|
fireExceptionCaught(channel, e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ChannelBuffer a = (ChannelBuffer) message;
|
ChannelBuffer a = (ChannelBuffer) message;
|
||||||
int bytes = a.readableBytes();
|
int bytes = a.readableBytes();
|
||||||
|
Loading…
Reference in New Issue
Block a user