Skip to content

Commit 892e517

Browse files
committed
Work around Framework regression in handling of null model values
See spring-projects/spring-framework#23038.
1 parent d21a091 commit 892e517

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ public Map<String, Object> getErrorAttributes(ServerRequest request,
9191
HttpStatus errorStatus = determineHttpStatus(error, responseStatusAnnotation);
9292
errorAttributes.put("status", errorStatus.value());
9393
errorAttributes.put("error", errorStatus.getReasonPhrase());
94-
errorAttributes.put("message", determineMessage(error, responseStatusAnnotation));
94+
String message = determineMessage(error, responseStatusAnnotation);
95+
errorAttributes.put("message", (message != null) ? message : "");
9596
errorAttributes.put("requestId", request.exchange().getRequest().getId());
9697
handleException(errorAttributes, determineException(error), includeStackTrace);
9798
return errorAttributes;

0 commit comments

Comments
 (0)