diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTLSTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTLSTest.java index 14fc9994c3f..4b768387196 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTLSTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTLSTest.java @@ -826,7 +826,8 @@ public class HttpClientTLSTest public ByteBuffer acquire(int size, boolean direct) { ByteBuffer acquired = super.acquire(size, direct); - leakedBuffers.add(acquired); + if (acquired != null) + leakedBuffers.add(acquired); return acquired; } @@ -895,7 +896,8 @@ public class HttpClientTLSTest public ByteBuffer acquire(int size, boolean direct) { ByteBuffer acquired = super.acquire(size, direct); - leakedBuffers.add(acquired); + if (acquired != null) + leakedBuffers.add(acquired); return acquired; } @@ -978,7 +980,8 @@ public class HttpClientTLSTest public ByteBuffer acquire(int size, boolean direct) { ByteBuffer acquired = super.acquire(size, direct); - leakedBuffers.add(acquired); + if (acquired != null) + leakedBuffers.add(acquired); return acquired; }