We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23fc6f6 commit cd403f4Copy full SHA for cd403f4
spring-web/src/main/java/org/springframework/http/ResponseEntity.java
@@ -223,6 +223,7 @@ public static BodyBuilder status(int status) {
223
* @since 5.1
224
*/
225
public static <T> ResponseEntity<T> of(Optional<T> body) {
226
+ Assert.notNull(body, "Body must not be null");
227
return body.map(ResponseEntity::ok).orElse(notFound().build());
228
}
229
0 commit comments