Fix possible NPE which will be thrown if the Buffer was set to null and after that Exception was thrown. See #166

This commit is contained in:
Norman Maurer 2012-01-31 11:10:32 +01:00
parent dbc37c1e19
commit 8c6820be64

View File

@ -484,7 +484,9 @@ class NioWorker implements Runnable {
} catch (AsynchronousCloseException e) {
// Doesn't need a user attention - ignore.
} catch (Throwable t) {
buf.release();
if (buf != null) {
buf.release();
}
channel.currentWriteEvent = null;
channel.currentWriteBuffer = null;
buf = null;