Browse Source

Polish

pull/1929/head
Brian Clozel 6 years ago
parent
commit
cd403f4180
  1. 1
      spring-web/src/main/java/org/springframework/http/ResponseEntity.java

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

@ -223,6 +223,7 @@ public class ResponseEntity<T> extends HttpEntity<T> { @@ -223,6 +223,7 @@ public class ResponseEntity<T> extends HttpEntity<T> {
* @since 5.1
*/
public static <T> ResponseEntity<T> of(Optional<T> body) {
Assert.notNull(body, "Body must not be null");
return body.map(ResponseEntity::ok).orElse(notFound().build());
}

Loading…
Cancel
Save