IDEMPIERE-293 Fixing exception thrown on session timeout

This commit is contained in:
Deepak Pansheriya 2012-10-24 00:26:17 +05:30
parent e2618e7232
commit 193954e7d7
1 changed files with 6 additions and 2 deletions

View File

@ -308,6 +308,9 @@ public class SessionContextListener implements ExecutionInit,
public void cleanup(Desktop desktop) throws Exception { public void cleanup(Desktop desktop) throws Exception {
if (ServerContext.getCurrentInstance().isEmpty() || !isContextValid()) if (ServerContext.getCurrentInstance().isEmpty() || !isContextValid())
{ {
if(Executions.getCurrent()==null)
return;
setupExecutionContextFromSession(Executions.getCurrent()); setupExecutionContextFromSession(Executions.getCurrent());
} }
MSession mSession = MSession.get(Env.getCtx(), false); MSession mSession = MSession.get(Env.getCtx(), false);
@ -322,6 +325,7 @@ public class SessionContextListener implements ExecutionInit,
public void init(Desktop desktop, Object request) throws Exception { public void init(Desktop desktop, Object request) throws Exception {
if (ServerContext.getCurrentInstance().isEmpty() || !isContextValid()) if (ServerContext.getCurrentInstance().isEmpty() || !isContextValid())
{ {
if(Executions.getCurrent()!=null)
setupExecutionContextFromSession(Executions.getCurrent()); setupExecutionContextFromSession(Executions.getCurrent());
} }
MSession mSession = MSession.get(Env.getCtx(), false); MSession mSession = MSession.get(Env.getCtx(), false);