Allow for decode method to return null in AbstractJackson2Decoder

Prior to this commit, the decoder did not allow for a null value
returned from the Jackson object reader.

Closes: gh-23935
This commit is contained in:
Arjen Poutsma
2019-11-07 16:10:53 +01:00
parent 789f6fc188
commit a7a88371e7
2 changed files with 20 additions and 1 deletions

View File

@@ -130,7 +130,7 @@ public abstract class AbstractJackson2Decoder extends Jackson2CodecSupport imple
@Nullable MimeType mimeType, @Nullable Map<String, Object> hints) {
return DataBufferUtils.join(input, this.maxInMemorySize)
.map(dataBuffer -> decode(dataBuffer, elementType, mimeType, hints));
.flatMap(dataBuffer -> Mono.justOrEmpty(decode(dataBuffer, elementType, mimeType, hints)));
}
@Override