Allow null values to async handler methods

Previously when the argument contained a null value (for example for nullified
continuation when using a suspend fun), it would fail to convert the arguments,
because of a `NullPointerException`.

By allowing the mono value be nullable it converts the arguments successfully.

Closes gh-239
This commit is contained in:
Koen Punt
2021-12-30 12:20:21 +01:00
committed by rstoyanchev
parent c9d41ce955
commit 3fc447e50d

View File

@@ -96,7 +96,7 @@ public abstract class InvocableHandlerMethodSupport extends HandlerMethod {
List<Mono<Object>> monoList = Arrays.stream(args)
.map(arg -> {
Mono<Object> argMono = (arg instanceof Mono ? (Mono<Object>) arg : Mono.just(arg));
Mono<Object> argMono = (arg instanceof Mono ? (Mono<Object>) arg : Mono.justOrEmpty(arg));
return argMono.defaultIfEmpty(NO_VALUE);
})
.collect(Collectors.toList());