Fix NPE for null HttpContext in minimal async clients

This commit is contained in:
slisaasquatch 2020-03-06 11:31:42 -08:00 committed by Oleg Kalnichevski
parent 99f7d2b710
commit ffa0530bb2
2 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ public final class MinimalH2AsyncClient extends AbstractMinimalHttpAsyncClientBa
final HttpContext context) {
ensureRunning();
final ComplexCancellable cancellable = new ComplexCancellable();
final HttpClientContext clientContext = HttpClientContext.adapt(context);
final HttpClientContext clientContext = context != null ? HttpClientContext.adapt(context) : HttpClientContext.create();
try {
exchangeHandler.produceRequest(new RequestChannel() {

View File

@ -248,7 +248,7 @@ public final class MinimalHttpAsyncClient extends AbstractMinimalHttpAsyncClient
final HttpContext context) {
ensureRunning();
final ComplexCancellable cancellable = new ComplexCancellable();
final HttpClientContext clientContext = HttpClientContext.adapt(context);
final HttpClientContext clientContext = context != null ? HttpClientContext.adapt(context) : HttpClientContext.create();
try {
exchangeHandler.produceRequest(new RequestChannel() {