Skip to content

Commit cd403f4

Browse files
committed
Polish
1 parent 23fc6f6 commit cd403f4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spring-web/src/main/java/org/springframework/http/ResponseEntity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ public static BodyBuilder status(int status) {
223223
* @since 5.1
224224
*/
225225
public static <T> ResponseEntity<T> of(Optional<T> body) {
226+
Assert.notNull(body, "Body must not be null");
226227
return body.map(ResponseEntity::ok).orElse(notFound().build());
227228
}
228229

0 commit comments

Comments
 (0)