Improve CMS start up and status reporting.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / auth / RemoteCmsSessionImpl.java
index 41ee7797b6c4f7cab63f81ec72acd0d5263a163f..23f5d8427e061001b83e3b546a14ab02dc652ce2 100644 (file)
@@ -16,7 +16,8 @@ public class RemoteCmsSessionImpl extends CmsSessionImpl {
 
        public RemoteCmsSessionImpl(UUID uuid, Subject initialSubject, Authorization authorization, Locale locale,
                        RemoteAuthRequest request) {
-               super(uuid, initialSubject, authorization, locale, request.getSession().getId());
+               super(uuid, initialSubject, authorization, locale,
+                               request.getSession() != null ? request.getSession().getId() : null);
                httpSession = request.getSession();
        }
 
@@ -24,6 +25,8 @@ public class RemoteCmsSessionImpl extends CmsSessionImpl {
        public boolean isValid() {
                if (isClosed())
                        return false;
+               if (httpSession == null)
+                       return true;
                return httpSession.isValid();
        }
 }