Skip to content

Commit ec3d4fa

Browse files
committed
Merge branch '1.1.x'
2 parents 826c550 + 2a3b5d2 commit ec3d4fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

samples/demo-authorizationserver/src/main/java/sample/web/DefaultErrorController.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.springframework.boot.web.servlet.error.ErrorController;
2222
import org.springframework.stereotype.Controller;
2323
import org.springframework.ui.Model;
24+
import org.springframework.util.StringUtils;
2425
import org.springframework.web.bind.annotation.RequestMapping;
2526

2627
/**
@@ -44,7 +45,8 @@ public String handleError(Model model, HttpServletRequest request) {
4445
}
4546

4647
private String getErrorMessage(HttpServletRequest request) {
47-
return (String) request.getAttribute(RequestDispatcher.ERROR_MESSAGE);
48+
String errorMessage = (String) request.getAttribute(RequestDispatcher.ERROR_MESSAGE);
49+
return StringUtils.hasText(errorMessage) ? errorMessage : "";
4850
}
4951

5052
}

0 commit comments

Comments
 (0)