SusiMail: Catch ISE in get/setAttribute() (ticket #1529)

This commit is contained in:
zzz
2018-07-28 19:48:22 +00:00
parent 9b9f96daf8
commit f12dbba3d6

View File

@ -1839,15 +1839,23 @@ public class WebMail extends HttpServlet
*/ */
private synchronized SessionObject getSessionObject( HttpSession httpSession ) private synchronized SessionObject getSessionObject( HttpSession httpSession )
{ {
SessionObject sessionObject = (SessionObject)httpSession.getAttribute( "sessionObject" ); SessionObject sessionObject = null;
try {
sessionObject = (SessionObject)httpSession.getAttribute("sessionObject");
} catch (IllegalStateException ise) {}
if( sessionObject == null ) { if( sessionObject == null ) {
sessionObject = new SessionObject(_log); sessionObject = new SessionObject(_log);
httpSession.setAttribute( "sessionObject", sessionObject ); try {
httpSession.setAttribute("sessionObject", sessionObject);
} catch (IllegalStateException ise) {}
if (_log.shouldDebug()) _log.debug("NEW session " + httpSession.getId()); if (_log.shouldDebug()) _log.debug("NEW session " + httpSession.getId());
} else { } else {
if (_log.shouldDebug()) _log.debug("Existing session " + httpSession.getId() + if (_log.shouldDebug()) {
" created " + new Date(httpSession.getCreationTime())); try {
_log.debug("Existing session " + httpSession.getId() +
" created " + new Date(httpSession.getCreationTime()));
} catch (IllegalStateException ise) {}
}
} }
return sessionObject; return sessionObject;
} }