Avoid NPE in error controller
This commit is contained in:
parent
3fc8752a37
commit
4c4e013c5e
|
|
@ -84,7 +84,7 @@ public class BasicErrorController implements ErrorController {
|
||||||
}
|
}
|
||||||
map.put("status", status);
|
map.put("status", status);
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
while (error instanceof ServletException) {
|
while (error instanceof ServletException && error.getCause() != null) {
|
||||||
error = ((ServletException) error).getCause();
|
error = ((ServletException) error).getCause();
|
||||||
}
|
}
|
||||||
map.put("exception", error.getClass().getName());
|
map.put("exception", error.getClass().getName());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue