mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
SPR-7145 - NullPointerException in AnnotationMethodHandlerAdapter if HttpHeaders in ResponseEntity are empty
This commit is contained in:
+4
-1
@@ -912,7 +912,10 @@ public class AnnotationMethodHandlerAdapter extends WebContentGenerator
|
||||
if (!entityHeaders.isEmpty()) {
|
||||
outputMessage.getHeaders().putAll(entityHeaders);
|
||||
}
|
||||
writeWithMessageConverters(responseEntity.getBody(), inputMessage, outputMessage);
|
||||
Object body = responseEntity.getBody();
|
||||
if (body != null) {
|
||||
writeWithMessageConverters(body, inputMessage, outputMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user