Browse Source

Fix NPE in ServletServerHttpResponse.ResponseBodyProcessor.write

Issue: SPR-14941
pull/1242/merge
Violeta Georgieva 8 years ago committed by Arjen Poutsma
parent
commit
6f222609c2
  1. 6
      spring-web/src/main/java/org/springframework/http/server/reactive/AbstractResponseBodyProcessor.java

6
spring-web/src/main/java/org/springframework/http/server/reactive/AbstractResponseBodyProcessor.java

@ -221,9 +221,11 @@ abstract class AbstractResponseBodyProcessor implements Processor<DataBuffer, Vo @@ -221,9 +221,11 @@ abstract class AbstractResponseBodyProcessor implements Processor<DataBuffer, Vo
if (dataBuffer.readableByteCount() == 0) {
processor.subscription.request(1);
}
else if (processor.changeState(this, RECEIVED)) {
else {
processor.receiveBuffer(dataBuffer);
processor.writeIfPossible();
if (processor.changeState(this, RECEIVED)) {
processor.writeIfPossible();
}
}
}

Loading…
Cancel
Save