aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/com/vaadin/server/WrappedHttpServletRequest.java8
-rw-r--r--server/src/com/vaadin/server/WrappedPortletRequest.java10
2 files changed, 15 insertions, 3 deletions
diff --git a/server/src/com/vaadin/server/WrappedHttpServletRequest.java b/server/src/com/vaadin/server/WrappedHttpServletRequest.java
index adfbde87ef..99e8881ec1 100644
--- a/server/src/com/vaadin/server/WrappedHttpServletRequest.java
+++ b/server/src/com/vaadin/server/WrappedHttpServletRequest.java
@@ -18,6 +18,7 @@ package com.vaadin.server;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpSession;
import com.vaadin.server.VaadinServlet.ServletService;
@@ -61,7 +62,12 @@ public class WrappedHttpServletRequest extends HttpServletRequestWrapper
@Override
public WrappedSession getWrappedSession(boolean allowSessionCreation) {
- return new WrappedHttpSession(getSession(allowSessionCreation));
+ HttpSession session = getSession(allowSessionCreation);
+ if (session != null) {
+ return new WrappedHttpSession(session);
+ } else {
+ return null;
+ }
}
/**
diff --git a/server/src/com/vaadin/server/WrappedPortletRequest.java b/server/src/com/vaadin/server/WrappedPortletRequest.java
index 78bfe838b1..d4670cfd92 100644
--- a/server/src/com/vaadin/server/WrappedPortletRequest.java
+++ b/server/src/com/vaadin/server/WrappedPortletRequest.java
@@ -23,6 +23,7 @@ import java.util.Map;
import javax.portlet.ClientDataRequest;
import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
import javax.portlet.ResourceRequest;
import com.vaadin.server.VaadinPortlet.PortletService;
@@ -119,8 +120,13 @@ public class WrappedPortletRequest implements WrappedRequest {
@Override
public WrappedSession getWrappedSession(boolean allowSessionCreation) {
- return new WrappedPortletSession(
- request.getPortletSession(allowSessionCreation));
+ PortletSession session = request
+ .getPortletSession(allowSessionCreation);
+ if (session != null) {
+ return new WrappedPortletSession(session);
+ } else {
+ return null;
+ }
}
/**