Quellcode durchsuchen

Improved exception handling if response already committed.

Ben Alex vor 21 Jahren
Ursprung
Commit
3f6961d855

+ 5 - 1
core/src/main/java/org/acegisecurity/ui/webapp/HttpSessionIntegrationFilter.java

@@ -105,7 +105,11 @@ public class HttpSessionIntegrationFilter extends AbstractIntegrationFilter {
 
     public Object extractFromContainer(ServletRequest request) {
         if (request instanceof HttpServletRequest) {
-            HttpSession httpSession = ((HttpServletRequest) request).getSession();
+            HttpSession httpSession = null;
+
+            try {
+                httpSession = ((HttpServletRequest) request).getSession();
+            } catch (IllegalStateException ignored) {}
 
             if (httpSession != null) {
                 Object authObject = httpSession.getAttribute(ACEGI_SECURITY_AUTHENTICATION_KEY);