Merge pull request #1649 from jacobslei/master

fixed: handler 可能为非HandlerMethod 类型,出现类型转换异常
master
许雪里 5 years ago committed by GitHub
commit f5155e9d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java

@ -34,10 +34,12 @@ public class WebExceptionResolver implements HandlerExceptionResolver {
// if json
boolean isJson = false;
HandlerMethod method = (HandlerMethod)handler;
ResponseBody responseBody = method.getMethodAnnotation(ResponseBody.class);
if (responseBody != null) {
isJson = true;
if (handler instanceof HandlerMethod) {
HandlerMethod method = (HandlerMethod)handler;
ResponseBody responseBody = method.getMethodAnnotation(ResponseBody.class);
if (responseBody != null) {
isJson = true;
}
}
// error result

Loading…
Cancel
Save