HTTPCLIENT-2126: `AsyncCachingExec` throws NPE when response body is null

This commit is contained in:
Oleg Kalnichevski 2020-11-05 15:09:31 +01:00
parent f8fa3f3667
commit c9489606d5
1 changed files with 3 additions and 1 deletions

View File

@ -157,7 +157,9 @@ class AsyncCachingExec extends CachingExecBase implements AsyncExecChainHandler
cacheResponse,
content != null ? new BasicEntityDetails(content.length, contentType) : null);
if (dataConsumer != null) {
dataConsumer.consume(ByteBuffer.wrap(content));
if (content != null) {
dataConsumer.consume(ByteBuffer.wrap(content));
}
dataConsumer.streamEnd(null);
}
asyncExecCallback.completed();