fix NPE when no session exists
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 29 Aug 2007 11:47:56 +0000 (11:47 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 29 Aug 2007 11:47:56 +0000 (11:47 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2353 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/session/impl/SessionManagerImpl.java

index 5bcdc0f..21c56f7 100644 (file)
@@ -100,7 +100,11 @@ public class SessionManagerImpl implements SessionManager<Session>, ApplicationC
 
     /** {@inheritDoc} */
     public Session getSession(String sessionID) {
 
     /** {@inheritDoc} */
     public Session getSession(String sessionID) {
-        SessionManagerEntry sessionEntry = sessionStore.get(partition, sessionID); 
+        SessionManagerEntry sessionEntry = sessionStore.get(partition, sessionID);
+        if(sessionEntry == null){
+            return null;
+        }
+        
         if(sessionEntry.isExpired()){
             destroySession(sessionEntry.getSessionId());
             return null;
         if(sessionEntry.isExpired()){
             destroySession(sessionEntry.getSessionId());
             return null;