Merge pull request #311 from glyptodon/login-npe

GUAC-1442: Do not attempt to remove/retrieve tokens that do not exist.
This commit is contained in:
James Muehlner
2015-12-17 21:26:42 -08:00

View File

@@ -151,6 +151,10 @@ public class BasicTokenSessionMap implements TokenSessionMap {
@Override
public GuacamoleSession get(String authToken) {
// There are no null auth tokens
if (authToken == null)
return null;
// Update the last access time and return the GuacamoleSession
GuacamoleSession session = sessionMap.get(authToken);
if (session != null)
@@ -167,7 +171,14 @@ public class BasicTokenSessionMap implements TokenSessionMap {
@Override
public GuacamoleSession remove(String authToken) {
// There are no null auth tokens
if (authToken == null)
return null;
// Attempt to retrieve only if non-null
return sessionMap.remove(authToken);
}
@Override