From 892e517c217908cff902419124be79353386559c Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 28 May 2019 10:05:59 +0100 Subject: [PATCH] Work around Framework regression in handling of null model values See https://github.com/spring-projects/spring-framework/issues/23038. --- .../boot/web/reactive/error/DefaultErrorAttributes.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java index 19515f178c..ccf1682c99 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java @@ -91,7 +91,8 @@ public class DefaultErrorAttributes implements ErrorAttributes { HttpStatus errorStatus = determineHttpStatus(error, responseStatusAnnotation); errorAttributes.put("status", errorStatus.value()); errorAttributes.put("error", errorStatus.getReasonPhrase()); - errorAttributes.put("message", determineMessage(error, responseStatusAnnotation)); + String message = determineMessage(error, responseStatusAnnotation); + errorAttributes.put("message", (message != null) ? message : ""); errorAttributes.put("requestId", request.exchange().getRequest().getId()); handleException(errorAttributes, determineException(error), includeStackTrace); return errorAttributes;