From cd403f4180cefea7ab7893125389eedb6f89464c Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Wed, 15 Aug 2018 20:56:27 +0200 Subject: [PATCH] Polish --- .../src/main/java/org/springframework/http/ResponseEntity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-web/src/main/java/org/springframework/http/ResponseEntity.java b/spring-web/src/main/java/org/springframework/http/ResponseEntity.java index 65c94c3b9b..7829613ec0 100644 --- a/spring-web/src/main/java/org/springframework/http/ResponseEntity.java +++ b/spring-web/src/main/java/org/springframework/http/ResponseEntity.java @@ -223,6 +223,7 @@ public class ResponseEntity extends HttpEntity { * @since 5.1 */ public static ResponseEntity of(Optional body) { + Assert.notNull(body, "Body must not be null"); return body.map(ResponseEntity::ok).orElse(notFound().build()); } -- GitLab