Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes a NullpointerException in the ClientRequestExecutor

  • Loading branch information...
commit 29adb785077b0de6828b94c82c58021c4947c4a2 2 parents 932a8ec + 5e1a78a
@ctasada authored
View
28 src/java/voldemort/store/socket/clientrequest/ClientRequestExecutor.java
@@ -184,21 +184,25 @@ protected void read(SelectionKey selectionKey) throws IOException {
// the position to 0 in preparation for reading in the RequestHandler.
inputStream.getBuffer().flip();
- if(!clientRequest.isCompleteResponse(inputStream.getBuffer())) {
- // Ouch - we're missing some data for a full request, so handle that
- // and return.
- handleIncompleteRequest(position);
- return;
- }
+ if(clientRequest != null) {
+ if(!clientRequest.isCompleteResponse(inputStream.getBuffer())) {
+ // Ouch - we're missing some data for a full request, so handle
+ // that
+ // and return.
+ handleIncompleteRequest(position);
+ return;
+ }
- // At this point we have the full request (and it's not streaming), so
- // rewind the buffer for reading and execute the request.
- inputStream.getBuffer().rewind();
+ // At this point we have the full request (and it's not streaming),
+ // so
+ // rewind the buffer for reading and execute the request.
+ inputStream.getBuffer().rewind();
- if(logger.isTraceEnabled())
- logger.trace("Starting read for " + socketChannel.socket());
+ if(logger.isTraceEnabled())
+ logger.trace("Starting read for " + socketChannel.socket());
- clientRequest.parseResponse(new DataInputStream(inputStream));
+ clientRequest.parseResponse(new DataInputStream(inputStream));
+ }
// At this point we've completed a full stand-alone request. So clear
// our input buffer and prepare for outputting back to the client.
Please sign in to comment.
Something went wrong with that request. Please try again.