Skip to content

Commit

Permalink
[UNDERTOW-1507] Add null checks on HttpClientConnection.ClientReadLis…
Browse files Browse the repository at this point in the history
…tener#handleEvent()

Issue: https://issues.jboss.org/browse/UNDERTOW-1507
  • Loading branch information
iweiss committed Jul 29, 2019
1 parent a7477cd commit ca797a8
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,10 @@ public void handleEvent(StreamSourceChannel channel) {
UndertowLogger.CLIENT_LOGGER.debugf(e, "Connection closed with IOException");
}
try {
currentRequest.setFailed(e);
currentRequest = null;
if (currentRequest != null) {
currentRequest.setFailed(e);
currentRequest = null;
}
pendingResponse = null;
} finally {
safeClose(channel, HttpClientConnection.this);
Expand All @@ -575,8 +577,10 @@ public void handleEvent(StreamSourceChannel channel) {
channel.suspendReads();
try {
// Cancel the current active request
currentRequest.setFailed(new IOException(MESSAGES.connectionClosed()));
currentRequest = null;
if (currentRequest != null) {
currentRequest.setFailed(new IOException(MESSAGES.connectionClosed()));
currentRequest = null;
}
pendingResponse = null;
} finally {
safeClose(HttpClientConnection.this);
Expand Down

0 comments on commit ca797a8

Please sign in to comment.