Browse Source

Improve check for actual return value type

Issue: SPR-15910
pull/1507/merge
Rossen Stoyanchev 7 years ago
parent
commit
03eb6f76db
  1. 3
      spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java

3
spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java

@ -101,7 +101,8 @@ public abstract class AbstractMessageWriterResultHandler extends HandlerResultHa @@ -101,7 +101,8 @@ public abstract class AbstractMessageWriterResultHandler extends HandlerResultHa
}
else {
publisher = Mono.justOrEmpty(body);
elementType = (bodyClass == null && body != null ? ResolvableType.forInstance(body) : bodyType);
elementType = ((bodyClass == null || bodyClass.equals(Object.class)) && body != null ?
ResolvableType.forInstance(body) : bodyType);
}
if (void.class == elementType.getRawClass() || Void.class == elementType.getRawClass()) {

Loading…
Cancel
Save