If SessionHandler.newHttpSession(Request) fails to create a session it returns null. Request.getSession(true) cannot throw a checked exception, nor can it return null, so we should throw ISE. Signed-off-by: Jan Bartel <janb@webtide.com>
This commit is contained in:
parent
c7e52eeecb
commit
eb02009f87
|
@ -1623,6 +1623,9 @@ public class Request implements HttpServletRequest
|
||||||
throw new IllegalStateException("No SessionManager");
|
throw new IllegalStateException("No SessionManager");
|
||||||
|
|
||||||
_session = _sessionHandler.newHttpSession(this);
|
_session = _sessionHandler.newHttpSession(this);
|
||||||
|
if (_session == null)
|
||||||
|
throw new IllegalStateException("Create session failed");
|
||||||
|
|
||||||
HttpCookie cookie = _sessionHandler.getSessionCookie(_session, getContextPath(), isSecure());
|
HttpCookie cookie = _sessionHandler.getSessionCookie(_session, getContextPath(), isSecure());
|
||||||
if (cookie != null)
|
if (cookie != null)
|
||||||
_channel.getResponse().replaceCookie(cookie);
|
_channel.getResponse().replaceCookie(cookie);
|
||||||
|
|
Loading…
Reference in New Issue