From a810ce9ce0bafce6d9b437582e706175f4c8827a Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Mon, 7 May 2012 13:16:13 +0000 Subject: Don't assume there's always an application (#8694) svn changeset:23684/svn branch:6.8 --- .../vaadin/terminal/gwt/server/AbstractApplicationPortlet.java | 8 +++++--- .../vaadin/terminal/gwt/server/AbstractApplicationServlet.java | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/com/vaadin') diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index 1741ec5e7f..2ac574c2de 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -495,9 +495,11 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet } } finally { - requestTimer - .stop((AbstractWebApplicationContext) application - .getContext()); + PortletSession session = request + .getPortletSession(false); + if (session != null) { + requestTimer.stop(getApplicationContext(session)); + } } } } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index d42b2142fe..68089e18e0 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -552,9 +552,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements .onRequestEnd(request, response); } } finally { - requestTimer - .stop((AbstractWebApplicationContext) application - .getContext()); + HttpSession session = request.getSession(false); + if (session != null) { + requestTimer.stop(getApplicationContext(session)); + } } } -- cgit v1.2.3