提交 cd403f41 编写于 作者: B Brian Clozel

Polish

上级 23fc6f6b
...@@ -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 * @since 5.1
*/ */
public static <T> ResponseEntity<T> of(Optional<T> body) { 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()); return body.map(ResponseEntity::ok).orElse(notFound().build());
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册