Fixed NPE in debug log

This commit is contained in:
Oleg Kalnichevski 2023-12-10 12:40:50 +01:00
parent 6ad6b82883
commit 9e3d79bede
1 changed files with 5 additions and 1 deletions

View File

@ -409,7 +409,11 @@ public class PoolingHttpClientConnectionManager
} }
} else { } else {
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("{} connection is not kept alive(isConsistent:{})", ConnPoolSupport.getId(endpoint), conn.isConsistent()); if (conn != null && !conn.isConsistent()) {
LOG.debug("{} connection is in an inconsistent state and cannot be kept alive)", ConnPoolSupport.getId(endpoint));
} else {
LOG.debug("{} connection is not kept alive)", ConnPoolSupport.getId(endpoint));
}
} }
} }
} catch (final RuntimeException ex) { } catch (final RuntimeException ex) {