Skip to content

Commit

Permalink
Fix NPE in JsonReaderHttpServerRequestMapper#apply
Browse files Browse the repository at this point in the history
Resolves #168
  • Loading branch information
mitasov-ra committed Jun 21, 2023
1 parent 53f9ddd commit 86587df
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ public Mono<T> apply(HttpServerRequest request) {
return ReactorUtils.toByteArrayMono(request.body())
.handle((bytes, sink) -> {
try {
sink.next(this.reader.read(bytes));
var body = this.reader.read(bytes);
if (body != null) {
sink.next(body);
} else {
sink.complete();
}
} catch (Exception e) {
var httpException = HttpServerResponseException.of(e, 400, e.getMessage());
sink.error(httpException);
Expand Down

0 comments on commit 86587df

Please sign in to comment.