Fixed NPE in debug log

This commit is contained in:
Oleg Kalnichevski 2023-12-10 12:40:50 +01:00
parent 6ad6b82883
commit 9e3d79bede

View File

@ -409,7 +409,11 @@ public void release(final ConnectionEndpoint endpoint, final Object state, final
}
} else {
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) {