Author: dashorst Date: Fri Jul 8 09:36:54 2011 New Revision: 1144212 URL: http://svn.apache.org/viewvc?rev=1144212&view=rev Log: Fixes NPE when sessions are invalidated *outside* a request, e.g. due to session timeout
Modified: wicket/trunk/wicket-core/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java Modified: wicket/trunk/wicket-core/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java?rev=1144212&r1=1144211&r2=1144212&view=diff ============================================================================== --- wicket/trunk/wicket-core/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java (original) +++ wicket/trunk/wicket-core/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java Fri Jul 8 09:36:54 2011 @@ -339,7 +339,10 @@ public class RequestLogger implements IR public void sessionDestroyed(String sessionId) { - RequestCycle.get().setMetaData(SESSION_DATA, liveSessions.remove(sessionId)); + RequestCycle requestCycle = RequestCycle.get(); + SessionData sessionData = liveSessions.remove(sessionId); + if (requestCycle != null) + requestCycle.setMetaData(SESSION_DATA, sessionData); } protected RequestData getCurrentRequest()