Skip to content

Commit

Permalink
Check if the data stream is not null in the async handler
Browse files Browse the repository at this point in the history
  • Loading branch information
rsumbaly committed Jun 9, 2011
1 parent b891756 commit c7f9498
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/java/voldemort/server/niosocket/AsyncRequestHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ protected void write(SelectionKey selectionKey) throws IOException {
+ outputStream.getBuffer().remaining() + " for "
+ socketChannel.socket());
} catch(IOException e) {
streamRequestHandler.close(new DataOutputStream(outputStream));
streamRequestHandler = null;
if(streamRequestHandler != null) {
streamRequestHandler.close(new DataOutputStream(outputStream));
streamRequestHandler = null;
}

throw e;
}
Expand Down

0 comments on commit c7f9498

Please sign in to comment.