Skip to content

Commit 9e3d79b

Browse files
committed
Fixed NPE in debug log
1 parent 6ad6b82 commit 9e3d79b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,11 @@ public void release(final ConnectionEndpoint endpoint, final Object state, final
409409
}
410410
} else {
411411
if (LOG.isDebugEnabled()) {
412-
LOG.debug("{} connection is not kept alive(isConsistent:{})", ConnPoolSupport.getId(endpoint), conn.isConsistent());
412+
if (conn != null && !conn.isConsistent()) {
413+
LOG.debug("{} connection is in an inconsistent state and cannot be kept alive)", ConnPoolSupport.getId(endpoint));
414+
} else {
415+
LOG.debug("{} connection is not kept alive)", ConnPoolSupport.getId(endpoint));
416+
}
413417
}
414418
}
415419
} catch (final RuntimeException ex) {

0 commit comments

Comments
 (0)