Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2017-01-19 11:43:50 +0000
committerIvan Furnadjiev2017-01-19 11:43:50 +0000
commitade9df34ede9dc9f48209259d814e9ec414bb7ad (patch)
tree6e5a4069a0c508e929e14d5728051ea27dafaaee /bundles
parent2486257b3a519c8c9b1ed13160472eaf5dafff7a (diff)
downloadorg.eclipse.rap-ade9df34ede9dc9f48209259d814e9ec414bb7ad.tar.gz
org.eclipse.rap-ade9df34ede9dc9f48209259d814e9ec414bb7ad.tar.xz
org.eclipse.rap-ade9df34ede9dc9f48209259d814e9ec414bb7ad.zip
Fix NPE in ServerPushManager when UI session is shutdown
In some rare cases it's possible to call isSessionExpired on already destroyed UI session. Return true immediately in this case. Change-Id: Ic461fb4d84499ca6221c111ccb456975ef2cba67
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/serverpush/ServerPushManager.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/serverpush/ServerPushManager.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/serverpush/ServerPushManager.java
index a8a51749bb..bb9ea1ffe4 100644
--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/serverpush/ServerPushManager.java
+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/serverpush/ServerPushManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2007, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -188,13 +188,16 @@ public final class ServerPushManager implements SerializableCompatibility {
}
static boolean isSessionExpired( long requestStartTime, long currentTime ) {
- boolean result = false;
- HttpSession httpSession = ContextProvider.getUISession().getHttpSession();
+ UISession uiSession = ContextProvider.getUISession();
+ if( uiSession == null ) {
+ return true;
+ }
+ HttpSession httpSession = uiSession.getHttpSession();
int maxInactiveInterval = httpSession.getMaxInactiveInterval();
if( maxInactiveInterval > 0 ) {
- result = currentTime > requestStartTime + maxInactiveInterval * 1000;
+ return currentTime > requestStartTime + maxInactiveInterval * 1000;
}
- return result;
+ return false;
}
private static boolean isConnectionAlive( HttpServletResponse response ) {

Back to the top