From 0e3c1da412d929a54ec8a96fb7c35ebd0acbef7b Mon Sep 17 00:00:00 2001 From: hiquanta Date: Thu, 20 Oct 2016 09:52:19 +0800 Subject: [PATCH] fix a bug for request /admin path --- src/main/java/com/raysmond/blog/WebConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/raysmond/blog/WebConfig.java b/src/main/java/com/raysmond/blog/WebConfig.java index e56e183..5db0610 100644 --- a/src/main/java/com/raysmond/blog/WebConfig.java +++ b/src/main/java/com/raysmond/blog/WebConfig.java @@ -53,7 +53,7 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView view) { CsrfToken token = (CsrfToken) request.getAttribute(CsrfToken.class.getName()); - if (token != null) { + if (token != null&&view!=null) { view.addObject(token.getParameterName(), token); } }