Fix NPE. Thanks to Tom Dunstan.

This commit is contained in:
Ben Alex 2005-09-22 01:49:12 +00:00
parent f5741962ed
commit 0f5e9ad372
1 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,7 @@ package net.sf.acegisecurity.ui;
import java.io.Serializable;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
@ -50,7 +51,9 @@ public class WebAuthenticationDetails implements Serializable {
public WebAuthenticationDetails(HttpServletRequest request,
boolean forceSessionCreation) {
this.remoteAddress = request.getRemoteAddr();
this.sessionId = request.getSession(forceSessionCreation).getId();
HttpSession session = request.getSession(forceSessionCreation);
this.sessionId = session != null ? session.getId() : null;
doPopulateAdditionalInformation(request);
}