Skip to content

Commit

Permalink
Refine publisher type check in CoroutinesUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeleuze committed Mar 11, 2024
1 parent 78fb378 commit 946082f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ public static Publisher<?> invokeSuspendingFunction(CoroutineContext context, Me
if (KTypes.isSubtypeOf(returnType, flowType)) {
return mono.flatMapMany(CoroutinesUtils::asFlux);
}
else if (KTypes.isSubtypeOf(returnType, monoType)) {
return mono.flatMap(o -> ((Mono<?>)o));
}
else if (KTypes.isSubtypeOf(returnType, publisherType)) {
if (KTypes.isSubtypeOf(returnType, publisherType)) {
if (KTypes.isSubtypeOf(returnType, monoType)) {
return mono.flatMap(o -> ((Mono<?>)o));
}
return mono.flatMapMany(o -> ((Publisher<?>)o));
}
return mono;
Expand Down

0 comments on commit 946082f

Please sign in to comment.