diff --git a/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java b/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java index f9af44c5101..14954b3b5dc 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java +++ b/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java @@ -975,9 +975,12 @@ final CloseFuture closeAsync() { phase.set(Phase.CLOSING); - for (Queue queue : pendingBorrows) { - for (PendingBorrow pendingBorrow : queue) { - pendingBorrow.setException(new ConnectionException(host.getEndPoint(), "Pool is shutdown")); + if (pendingBorrows != null) { + for (Queue queue : pendingBorrows) { + for (PendingBorrow pendingBorrow : queue) { + pendingBorrow.setException( + new ConnectionException(host.getEndPoint(), "Pool is shutdown")); + } } }