Skip to content

Commit f07873c

Browse files
committed
Merge branch '6.2.x'
2 parents 6ac13d1 + b19059f commit f07873c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spring-web/src/main/java/org/springframework/http/client/reactive/JdkClientHttpResponse.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ private static HttpHeaders adaptHeaders(HttpResponse<Flow.Publisher<List<ByteBuf
6767
private static Flux<DataBuffer> adaptBody(
6868
HttpResponse<Flow.Publisher<List<ByteBuffer>>> response, DataBufferFactory bufferFactory) {
6969

70-
return JdkFlowAdapter.flowPublisherToFlux(response.body())
70+
Flow.Publisher<List<ByteBuffer>> body = response.body();
71+
if (body == null) {
72+
return Flux.empty();
73+
}
74+
75+
return JdkFlowAdapter.flowPublisherToFlux(body)
7176
.flatMapIterable(Function.identity())
7277
.map(bufferFactory::wrap)
7378
.doOnDiscard(DataBuffer.class, DataBufferUtils::release)

0 commit comments

Comments
 (0)